mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix focusing
This commit is contained in:
parent
bb1c01635e
commit
519b5b7012
@ -220,6 +220,11 @@ function inventreeDocReady() {
|
|||||||
|
|
||||||
// Start notification background worker to check every 5 seconds if notifications are available
|
// Start notification background worker to check every 5 seconds if notifications are available
|
||||||
var notificationRunner = setInterval(notificationCheck, 5000);
|
var notificationRunner = setInterval(notificationCheck, 5000);
|
||||||
|
|
||||||
|
// also run when the focus returns
|
||||||
|
$(document).on('focus', function(e){
|
||||||
|
notificationCheck();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -229,6 +234,8 @@ function inventreeDocReady() {
|
|||||||
**/
|
**/
|
||||||
var current_alert_state = false;
|
var current_alert_state = false;
|
||||||
function notificationCheck() {
|
function notificationCheck() {
|
||||||
|
// only refresh state if in focus
|
||||||
|
if (document.hasFocus()) {
|
||||||
inventreeGet(
|
inventreeGet(
|
||||||
'/api/notifications/',
|
'/api/notifications/',
|
||||||
{
|
{
|
||||||
@ -250,6 +257,7 @@ function notificationCheck() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFileTransfer(transfer) {
|
function isFileTransfer(transfer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user