From 726003324b35801dab3179d562baa3d9b027f661 Mon Sep 17 00:00:00 2001 From: Leo Mouyna Date: Mon, 9 Dec 2019 21:38:29 +0100 Subject: [PATCH] fix: Clear errors on resend password page. Only add a new error if it's not in the list yet, and remove error from list when message is closed. See issue: #298 --- js/src/views/User/SendPasswordReset.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/src/views/User/SendPasswordReset.vue b/js/src/views/User/SendPasswordReset.vue index 35e67a588..fc33e7fc5 100644 --- a/js/src/views/User/SendPasswordReset.vue +++ b/js/src/views/User/SendPasswordReset.vue @@ -5,7 +5,10 @@

{{ $t('Password reset') }}

- {{ error }} + + {{ error }} +
@@ -59,6 +62,10 @@ export default class SendPasswordReset extends Vue { this.credentials.email = this.email; } + removeError(message: string) { + this.errors.splice(this.errors.indexOf(message)) + } + async sendResetPasswordTokenAction(e) { e.preventDefault(); @@ -74,7 +81,9 @@ export default class SendPasswordReset extends Vue { } catch (err) { console.error(err); err.graphQLErrors.forEach(({ message }) => { - this.errors.push(message); + if (this.errors.indexOf(message) < 0){ + this.errors.push(message); + } }); } }