Skip to content

Commit

Permalink
IBX-5369: Fixed admin notifications request being queued too often (#740
Browse files Browse the repository at this point in the history
)

Co-authored-by: tischsoic <symfiz@gmail.com>
  • Loading branch information
Steveb-p and tischsoic authored Mar 24, 2023
1 parent 9b300c2 commit ba7a27f
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
});

fetch(request)
return fetch(request)
.then(getJsonFromResponse)
.then((notificationsInfo) => {
setPendingNotificationCount(notificationsInfo);
Expand Down Expand Up @@ -169,6 +169,11 @@

modal.querySelectorAll(SELECTOR_MODAL_RESULTS).forEach((link) => link.addEventListener('click', handleModalResultsClick, false));

getNotificationsStatus();
global.setInterval(getNotificationsStatus, INTERVAL);
const getNotificationsStatusLoop = () => {
getNotificationsStatus().finally(() => {
global.setTimeout(getNotificationsStatusLoop, INTERVAL);
});
};

getNotificationsStatusLoop();
})(window, window.document, window.ibexa, window.Translator);

0 comments on commit ba7a27f

Please sign in to comment.