This commit is contained in:
Matthias 2021-11-28 01:45:40 +01:00
parent 5ebf50595e
commit d7bc16209d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 26 additions and 25 deletions

View File

@ -228,31 +228,6 @@ function inventreeDocReady() {
} }
/**
* The notification checker is initiated when the doc is loaded. It checks if there are unread notifications
* if unread messages exist the alert flag is raised by making it visible
**/
function notificationCheck() {
// only refresh state if in focus
if (document.hasFocus()) {
inventreeGet(
'/api/notifications/',
{
read: false,
},
{
success: function(response) {
if (response.length == 0) {
$("#notification-alert").addClass("d-none");
} else {
$("#notification-alert").removeClass("d-none");
}
}
}
);
}
}
function isFileTransfer(transfer) { function isFileTransfer(transfer) {
/* Determine if a transfer (e.g. drag-and-drop) is a file transfer /* Determine if a transfer (e.g. drag-and-drop) is a file transfer
*/ */

View File

@ -118,3 +118,29 @@ function showMessage(message, options={}) {
$(this).alert(close); $(this).alert(close);
}); });
} }
/**
* The notification checker is initiated when the document is loaded. It checks if there are unread notifications
* if unread messages exist the alert flag is raised by making it visible
**/
function notificationCheck() {
// only refresh state if in focus
if (document.hasFocus()) {
inventreeGet(
'/api/notifications/',
{
read: false,
},
{
success: function(response) {
if (response.length == 0) {
$("#notification-alert").addClass("d-none");
} else {
$("#notification-alert").removeClass("d-none");
}
}
}
);
}
}