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