Skip to content

Node.js based forum software built for the modern web

fix: change email button stays disabled if user submitted an invalid email

psychobunny01f63e5d58e8
diff --git a/public/src/client/account/edit/email.js b/public/src/client/account/edit/email.js
index b7561af08e..824b7aaf5e 100644
--- a/public/src/client/account/edit/email.js
+++ b/public/src/client/account/edit/email.js
@@ -29,7 +29,12 @@ define('forum/account/edit/email', ['forum/account/header', 'api'], function (he
api.put('/users/' + userData.uid, userData).then((res) => {
btn.removeClass('disabled').find('i').addClass('hide');
ajaxify.go('user/' + res.userslug + '/edit');
- }).catch(app.alertError);
+ }).catch((err) => {
+ setTimeout(() => {
+ btn.removeClass('disabled').find('i').addClass('hide');
+ app.alertError(err);
+ }, 300); // for UX: this call is too fast.
+ });
return false;
});