Skip to content

Commit 2ef0b8e

Browse files
committed
fix: remove form submit on new message send button
1 parent 6d1e5c3 commit 2ef0b8e

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

web/app/pages/bulk-messages/index.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ onMounted(async () => {
169169
</li>
170170
</ul>
171171
</VAlert>
172-
<form @submit.prevent="sendBulkMessages">
172+
<form>
173173
<VFileInput
174174
v-model="formFile"
175175
label="File"
@@ -180,16 +180,17 @@ onMounted(async () => {
180180
variant="outlined"
181181
/>
182182
<div class="d-flex">
183-
<VBtn
183+
<loading-button
184184
color="primary"
185185
type="submit"
186+
size="large"
186187
:loading="loading"
187188
:disabled="loading"
188-
size="large"
189+
:icon="mdiSendCheck"
190+
@click="sendBulkMessages"
189191
>
190-
<VIcon start :icon="mdiSendCheck" />
191192
Send Bulk Messages
192-
</VBtn>
193+
</loading-button>
193194
<VSpacer />
194195
<VBtn
195196
v-if="mdAndUp"

web/app/pages/phone-api-keys/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,13 @@ onBeforeUnmount(() => {
383383
</VForm>
384384
</VCardText>
385385
<VCardActions class="mt-n6 mb-1">
386-
<VBtn
386+
<loading-button
387387
color="primary"
388-
variant="flat"
389388
:loading="loading"
390389
@click="createPhoneApiKey"
391390
>
392391
Create<span v-if="lgAndUp" class="mx-1">Phone API</span>Key
393-
</VBtn>
392+
</loading-button>
394393
<VSpacer />
395394
<VBtn
396395
variant="text"

web/app/pages/settings/index.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function parseErrors(error: unknown): ErrorMessages {
9595
const bag = new ErrorMessages()
9696
const data = toApiError(error).data?.data
9797
if (data && typeof data === 'object') {
98-
Object.keys(data).forEach((key) => bag.addMany(key, data[key]))
98+
Object.keys(data).forEach((key) => bag.addMany(key, data[key]!))
9999
}
100100
return bag
101101
}
@@ -596,9 +596,9 @@ function scheduleWindowError(index: number): string | null {
596596
? errorMessages.value.get('windows')
597597
: []
598598
if (messages.length === 0) return null
599-
const message = messages.find((x) => x.includes(`Day of week ${index}`))
599+
const message = messages.find((x) => x.includes(`day_of_week ${index}`))
600600
return message
601-
? message.replace(`Day of week ${index}`, getWeekday(index))
601+
? message.replace(`day_of_week ${index}`, getWeekday(index))
602602
: null
603603
}
604604
@@ -631,7 +631,7 @@ async function saveSchedule() {
631631
await loadSendSchedules()
632632
} catch (error: unknown) {
633633
errorMessages.value = parseErrors(error)
634-
if (errorMessages.value.size() === 0) {
634+
if (errorMessages.value.size() != 0) {
635635
notificationsStore.addNotification({
636636
type: 'error',
637637
message: 'Failed to save send schedule',

web/app/pages/threads/[id]/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ onBeforeUnmount(() => {
516516
</div>
517517
<VFooter app class="py-0" color="#121212">
518518
<VContainer class="pb-0 pt-0">
519-
<VForm ref="form" class="d-flex" @submit.prevent="sendMessage">
519+
<VForm ref="form" class="d-flex">
520520
<VTextField
521521
v-model="formMessage"
522522
:disabled="submitting || !contactIsPhoneNumber"
@@ -537,6 +537,7 @@ onBeforeUnmount(() => {
537537
class="ml-2"
538538
icon
539539
size="large"
540+
@click="sendMessage"
540541
>
541542
<VProgressCircular
542543
v-if="submitting"

web/app/stores/phones.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const usePhonesStore = defineStore('phones', () => {
7272
message: getApiErrorMessage(error, 'Error while updating phone'),
7373
type: 'error',
7474
})
75+
throw error
7576
}
7677
}
7778

0 commit comments

Comments
 (0)