make more compact

This commit is contained in:
Matthias 2021-11-27 23:15:41 +01:00
parent 519b5b7012
commit 6735f83683
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -236,27 +236,21 @@ var current_alert_state = false;
function notificationCheck() {
// only refresh state if in focus
if (document.hasFocus()) {
inventreeGet(
'/api/notifications/',
{
read: false,
},
{
success: function(response) {
if (response.length == 0) {
if (current_alert_state == true){
inventreeGet(
'/api/notifications/',
{
read: false,
},
{
success: function(response) {
if (response.length == 0) {
$("#notification-alert").addClass("d-none");
current_alert_state = false;
}
} else {
if (current_alert_state == false){
} else {
$("#notification-alert").removeClass("d-none");
current_alert_state = true;
}
}
}
}
);
);
}
}