Skip to content

Commit

Permalink
Fix infinite "Please wait" message on error (#8249)
Browse files Browse the repository at this point in the history
If an error happens while using the delete, validate or other
option of the editor dashboard metadata actions menu then remove
the text "Please wait" and the spinner from the button to allow
to perform a new action.
  • Loading branch information
juanluisrp authored Jul 10, 2024
1 parent 4b9864a commit 4618834
Showing 1 changed file with 27 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,28 @@
);
} else {
$rootScope.$broadcast("operationOnSelectionStart");
$http.delete("../api/records?" + "bucket=" + bucket).then(
function (data) {
$rootScope.$broadcast("mdSelectNone");
$rootScope.$broadcast("operationOnSelectionStop");
$rootScope.$broadcast("search");
$timeout(function () {
$http
.delete("../api/records?" + "bucket=" + bucket)
.then(
function (data) {
$rootScope.$broadcast("mdSelectNone");
$rootScope.$broadcast("search");
}, 5000);
deferred.resolve(data);
},
function (data) {
gnAlertService.addAlert({
msg: data.data.message || data.data.description,
type: "danger"
});
deferred.reject(data);
}
);
$timeout(function () {
$rootScope.$broadcast("search");
}, 5000);
deferred.resolve(data);
},
function (data) {
gnAlertService.addAlert({
msg: data.data.message || data.data.description,
type: "danger"
});
deferred.reject(data);
}
)
.finally(function () {
$rootScope.$broadcast("operationOnSelectionStop");
});
}
return deferred.promise;
};
Expand Down Expand Up @@ -644,8 +648,10 @@
})
.then(function (data) {
$rootScope.$broadcast("inspireMdValidationStop");
$rootScope.$broadcast("operationOnSelectionStop");
$rootScope.$broadcast("search");
})
.finally(function () {
$rootScope.$broadcast("operationOnSelectionStop");
});
};

Expand All @@ -657,8 +663,10 @@
method: "DELETE"
})
.then(function (data) {
$rootScope.$broadcast("operationOnSelectionStop");
$rootScope.$broadcast("search");
})
.finally(function () {
$rootScope.$broadcast("operationOnSelectionStop");
});
};

Expand Down

0 comments on commit 4618834

Please sign in to comment.