From 1ede022dd8eacc5c3adda758d9df8d43355bf1a2 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Mon, 25 Jan 2021 20:52:21 -0500 Subject: [PATCH] ChangeEmailModal: dismiss alert on new request Removing old errors at the beginning of the next request, rather than at the end of the next successful request, makes it clearer that any new errors are caused by the new inputs. See https://github.com/flarum/core/pull/2467#issuecomment-749832787 --- framework/core/js/src/forum/components/ChangeEmailModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/js/src/forum/components/ChangeEmailModal.js b/framework/core/js/src/forum/components/ChangeEmailModal.js index 224d348c5..8fafd2ad7 100644 --- a/framework/core/js/src/forum/components/ChangeEmailModal.js +++ b/framework/core/js/src/forum/components/ChangeEmailModal.js @@ -109,6 +109,7 @@ export default class ChangeEmailModal extends Modal { const oldEmail = app.session.user.email(); this.loading = true; + this.alertAttrs = null; app.session.user .save( @@ -120,7 +121,6 @@ export default class ChangeEmailModal extends Modal { ) .then(() => { this.success = true; - this.alertAttrs = null; }) .catch(() => {}) .then(this.loaded.bind(this));