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
This commit is contained in:
Alexander Skvortsov 2021-01-25 20:52:21 -05:00
parent 99dee979a6
commit 1ede022dd8

View File

@ -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));