Always re-enable the primary button
This commit is contained in:
parent
30c49f66ee
commit
564b7dea25
|
@ -38,22 +38,24 @@ 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)
|
||||||
$alert.removeClass('d-none alert-danger alert-success');
|
.done((response) => {
|
||||||
|
$alert.removeClass('d-none alert-danger alert-success');
|
||||||
|
|
||||||
$getNewPassword.prop('disabled', false);
|
if (response.success) {
|
||||||
|
$alert.addClass('alert-success');
|
||||||
if (response.success) {
|
$alert.text(lang('new_password_sent_with_email'));
|
||||||
$alert.addClass('alert-success');
|
} else {
|
||||||
$alert.text(lang('new_password_sent_with_email'));
|
$alert.addClass('alert-danger');
|
||||||
} else {
|
$alert.text(
|
||||||
$alert.addClass('alert-danger');
|
'The operation failed! Please enter a valid username ' +
|
||||||
$alert.text(
|
'and email address in order to get a new password.',
|
||||||
'The operation failed! Please enter a valid username ' +
|
);
|
||||||
'and email address in order to get a new password.',
|
}
|
||||||
);
|
})
|
||||||
}
|
.always(() => {
|
||||||
});
|
$getNewPassword.prop('disabled', false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$form.on('submit', onFormSubmit);
|
$form.on('submit', onFormSubmit);
|
||||||
|
|
Loading…
Reference in New Issue