Skip to content

Commit

Permalink
ChangeEmailModal: dismiss alert on new request
Browse files Browse the repository at this point in the history
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 #2467 (comment)
  • Loading branch information
askvortsov1 committed Jan 26, 2021
1 parent 1851d16 commit 00913d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/forum/components/ChangeEmailModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -120,7 +121,6 @@ export default class ChangeEmailModal extends Modal {
)
.then(() => {
this.success = true;
this.alertAttrs = null;
})
.catch(() => {})
.then(this.loaded.bind(this));
Expand Down

0 comments on commit 00913d5

Please sign in to comment.