Always re-enable the primary button

This commit is contained in:
Alex Tselegidis 2024-07-04 12:47:24 +02:00
parent 30c49f66ee
commit 564b7dea25
1 changed files with 17 additions and 15 deletions

View File

@ -38,11 +38,10 @@ App.Pages.Recovery = (function () {
const username = $username.val(); const username = $username.val();
const email = $email.val(); const email = $email.val();
App.Http.Recovery.perform(username, email).done((response) => { App.Http.Recovery.perform(username, email)
.done((response) => {
$alert.removeClass('d-none alert-danger alert-success'); $alert.removeClass('d-none alert-danger alert-success');
$getNewPassword.prop('disabled', false);
if (response.success) { if (response.success) {
$alert.addClass('alert-success'); $alert.addClass('alert-success');
$alert.text(lang('new_password_sent_with_email')); $alert.text(lang('new_password_sent_with_email'));
@ -53,6 +52,9 @@ App.Pages.Recovery = (function () {
'and email address in order to get a new password.', 'and email address in order to get a new password.',
); );
} }
})
.always(() => {
$getNewPassword.prop('disabled', false);
}); });
} }