Improve error handling

This commit is contained in:
grandeljay 2022-06-16 14:44:59 +02:00
parent 1f5e14f9f2
commit 6c842cbd64

View file

@ -640,7 +640,7 @@ $(function () {
}
/** URL */
if (wishURLCurrent !== wishInfoProposed.url && validateURL) {
if (wishURLCurrent && wishInfoProposed.url && wishURLCurrent !== wishInfoProposed.url && validateURL) {
modalValidate.find('input.current').val(wishURLCurrent);
modalValidate.find('input.proposed').val(wishInfoProposed.url);
modalValidate
@ -706,7 +706,11 @@ $(function () {
/** */
}
})
.catch(handleFetchCatch);
.catch(handleFetchCatch)
.finally(function() {
formAddOrEdit.removeClass('loading');
buttonAddOrSave.removeClass('disabled');
});
} else {
/** Save form edit fields */
/** This code block is a duplicate, please refactor */