Skip to content

Commit bc8ebf9

Browse files
committed
fix: move cancel logic to functions
1 parent 755d165 commit bc8ebf9

1 file changed

Lines changed: 14 additions & 20 deletions

File tree

app/pages/account/settings.vue

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ async function confirmEmailChange() {
112112
}
113113
}
114114
115+
function cancelEmailChange() {
116+
isEmailCodeSent.value = false
117+
emailSuccess.value = ''
118+
emailError.value = ''
119+
}
120+
115121
const passwordEmail = ref('')
116122
const newPassword = ref('')
117123
const passwordToken = ref('')
@@ -175,6 +181,12 @@ async function confirmPasswordReset() {
175181
isConfirmingPassword.value = false
176182
}
177183
}
184+
185+
function cancelPasswordReset() {
186+
isPasswordCodeSent.value = false
187+
passwordSuccess.value = ''
188+
passwordError.value = ''
189+
}
178190
</script>
179191

180192
<template>
@@ -339,16 +351,7 @@ async function confirmPasswordReset() {
339351
{{ isConfirmingEmail ? 'Saving...' : 'Save New Email' }}
340352
</ButtonBase>
341353

342-
<ButtonBase
343-
variant="secondary"
344-
@click="
345-
isEmailCodeSent = false
346-
emailSuccess = ''
347-
emailError = ''
348-
"
349-
>
350-
Cancel
351-
</ButtonBase>
354+
<ButtonBase variant="secondary" @click="cancelEmailChange"> Cancel </ButtonBase>
352355
</div>
353356
</div>
354357
</section>
@@ -403,16 +406,7 @@ async function confirmPasswordReset() {
403406
{{ isConfirmingPassword ? 'Saving...' : 'Save New Password' }}
404407
</ButtonBase>
405408

406-
<ButtonBase
407-
variant="secondary"
408-
@click="
409-
isPasswordCodeSent = false
410-
passwordSuccess = ''
411-
passwordError = ''
412-
"
413-
>
414-
Cancel
415-
</ButtonBase>
409+
<ButtonBase variant="secondary" @click="cancelPasswordReset"> Cancel </ButtonBase>
416410
</div>
417411
</section>
418412
</div>

0 commit comments

Comments
 (0)