fix(settings): don't submit when clicking icon buttons
This commit is contained in:
parent
245a37db19
commit
4ea5d8ba60
|
@ -25,7 +25,7 @@ const chooseIcon = (i: number, text: string) => {
|
|||
<div v-for="i in 4" :key="i" flex="~ gap3" items-center>
|
||||
<CommonDropdown ref="dropdown" placement="left">
|
||||
<CommonTooltip content="Pick a icon">
|
||||
<button btn-action-icon>
|
||||
<button type="button" btn-action-icon>
|
||||
<div :class="fieldIcons[i - 1] || 'i-ri:question-mark'" />
|
||||
</button>
|
||||
</CommonTooltip>
|
||||
|
@ -37,9 +37,9 @@ const chooseIcon = (i: number, text: string) => {
|
|||
:content="text"
|
||||
>
|
||||
<template v-if="text !== 'Joined'">
|
||||
<div btn-action-icon @click="chooseIcon(i - 1, text)">
|
||||
<button type="button" btn-action-icon @click="chooseIcon(i - 1, text)">
|
||||
<div text-xl :class="icon" />
|
||||
</div>
|
||||
</button>
|
||||
</template>
|
||||
</CommonTooltip>
|
||||
</div>
|
||||
|
|
|
@ -54,6 +54,9 @@ onMastoInit(async () => {
|
|||
const isCanSubmit = computed(() => !isError.value && !isEmptyObject(dirtyFields.value))
|
||||
|
||||
const { submit, submitting } = submitter(async ({ dirtyFields }) => {
|
||||
if (!isCanSubmit.value)
|
||||
return
|
||||
|
||||
const res = await useMasto().accounts.updateCredentials(dirtyFields.value as UpdateCredentialsParams)
|
||||
.then(account => ({ account }))
|
||||
.catch((error: Error) => ({ error }))
|
||||
|
|
Loading…
Reference in a new issue