@@ -18,8 +18,8 @@ const router = useRouter();
1818const { mdAndDown } = useDisplay ();
1919const notificationsStore = useNotificationsStore ();
2020const phonesStore = usePhonesStore ();
21- const messagesStore = useMessagesStore ();
2221const { useApi } = useApiComposable ();
22+ const { formatPhoneNumber } = useFilters ();
2323
2424const sending = ref (false );
2525const formPhoneNumber = ref (" " );
@@ -56,6 +56,7 @@ async function sendMessage() {
5656 to: getRecipientNumber (),
5757 from: phonesStore .owner ,
5858 content: formContent .value ,
59+ sim: " DEFAULT" ,
5960 attachments: formAttachments .value
6061 .trim ()
6162 .split (" ," )
@@ -93,6 +94,10 @@ async function sendMessage() {
9394 sending .value = false ;
9495 }
9596}
97+
98+ onMounted (async () => {
99+ await phonesStore .loadPhones ();
100+ });
96101 </script >
97102
98103<template >
@@ -104,16 +109,18 @@ async function sendMessage() {
104109 </VBtn >
105110 <VToolbarTitle >
106111 New Message
107- <VIcon
108- size="x-small"
109- class="mx-2"
110- color="primary"
111- :icon =" mdiCircle "
112- />
113- {{ useFilters().phoneNumber(phonesStore.owner) }}
112+ <template v-if =" phonesStore .owner " >
113+ <VIcon
114+ size="12"
115+ class="mx-2"
116+ color="primary"
117+ :icon =" mdiCircle "
118+ />
119+ {{ formatPhoneNumber(phonesStore.owner) }}
120+ </template >
114121 </VToolbarTitle >
115122 </VAppBar >
116- <VContainer class="mt-16" >
123+ <VContainer >
117124 <VRow >
118125 <VCol cols="12" md="8" offset-md="2" xl="6" offset-xl="3">
119126 <form @submit.prevent =" sendMessage" >
@@ -124,6 +131,8 @@ async function sendMessage() {
124131 :error =" errors.has('to')"
125132 :error-messages =" errors.get('to')"
126133 variant =" outlined"
134+ color =" primary"
135+ density =" compact"
127136 persistent-placeholder
128137 placeholder =" Recipient phone number e.g 18005550199"
129138 label =" Phone Number"
@@ -135,6 +144,8 @@ async function sendMessage() {
135144 :error-messages =" errors .get (' content' )"
136145 :disabled =" sending "
137146 variant="outlined"
147+ density="compact"
148+ color="primary"
138149 persistent-placeholder
139150 placeholder="Enter your message here"
140151 label="Content"
@@ -145,23 +156,24 @@ async function sendMessage() {
145156 :error-messages =" errors .get (' attachments' )"
146157 :disabled =" sending "
147158 variant="outlined"
159+ density="compact"
148160 rows="2"
161+ color="primary"
149162 class="mb-8"
150163 persistent-placeholder
151164 persistent-hint
152165 hint="The message will be sent as an MMS when a comma separated list of attachment URLs are present"
153166 placeholder="https://example.com /image.jpg , https://example.com /video.mp4 "
154167 label="Attachment URLs (optional)"
155168 />
156- <VBtn
157- type="submit"
158- color="primary"
169+ <loading-button
159170 :disabled =" sending"
160171 :block =" mdAndDown"
172+ :loading =" sending"
173+ :icon =" mdiSend"
161174 >
162- <VIcon :icon =" mdiSend " />
163175 Send Message
164- </VBtn >
176+ </loading-button >
165177 </form >
166178 </VCol >
167179 </VRow >
0 commit comments