Skip to content

Commit 9e8f2b0

Browse files
committed
forgot password loading icon
1 parent 20794ee commit 9e8f2b0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

frontend/src/views/auth/ForgotPassword.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
<h1 class="auth-sub-container-content-heading">Forgot password?</h1>
1111
<h1 class="text-sm text-gray-matcha text-center">Enter your email and we will send you a link, so you can log in again</h1>
1212
</div>
13-
<div class="auth-sub-container-content mt-4" v-if="!forgotPasswordEmailSent">
14-
<ValidationObserver v-slot="{ handleSubmit, invalid }">
13+
<div class="auth-sub-container-content mt-4 w-full" v-if="!forgotPasswordEmailSent">
14+
<ValidationObserver v-slot="{ handleSubmit, invalid }" class="w-full">
1515
<form @submit.prevent="handleSubmit(onSubmit)">
1616
<ValidationProvider name="Email" rules="required|email|max:50" v-slot="{errors}">
1717
<input type="email" placeholder="Email" v-model="formData.email" class="matcha-input">
1818
<span class="matcha-input-error">{{ errors[0] }}</span>
1919
</ValidationProvider>
20-
<input type="submit" :disabled="invalid" value="Send reset link" v-bind:class="{'auth-sub-container-content-submit-button': true, 'opacity-50': invalid, 'cursor-pointer': !invalid}">
20+
<input v-if="!submitted" type="submit" :disabled="invalid" value="Send reset link" v-bind:class="{'auth-sub-container-content-submit-button': true, 'opacity-50': invalid, 'cursor-pointer': !invalid}">
21+
<div v-else class="flex items-center justify-center mt-4">
22+
<img class="h-12" src="../../assets/loading.svg">
23+
</div>
2124
</form>
2225
</ValidationObserver>
2326
</div>
@@ -47,15 +50,19 @@ export default {
4750
happened: false,
4851
message: '',
4952
},
53+
submitted: false,
5054
}),
5155
methods: {
5256
async onSubmit() {
5357
try {
58+
this.submitted = true;
5459
this.clearError();
5560
await this.sendResetPasswordLink();
5661
this.forgotPasswordEmailSent = true;
62+
this.submitted = false;
5763
} catch (error) {
5864
this.displayError(this.$errorMessenger(error));
65+
this.submitted = false;
5966
}
6067
},
6168
async sendResetPasswordLink() {

0 commit comments

Comments
 (0)