From 00913d5b0be2172cfce1f16aaf64a24f3d2e6d4b 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 --- js/src/forum/components/ChangeEmailModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/forum/components/ChangeEmailModal.js b/js/src/forum/components/ChangeEmailModal.js index 224d348c5..8fafd2ad7 100644 --- a/js/src/forum/components/ChangeEmailModal.js +++ b/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));