From 0f3952f9d70978fbf55ca1db1fc1e28ffd1bc78b Mon Sep 17 00:00:00 2001 From: tischsoic Date: Wed, 22 Mar 2023 11:06:02 +0100 Subject: [PATCH] small frontend refactor --- .../public/js/scripts/admin.notifications.modal.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js index 5de705d421..edf17b0bf6 100644 --- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js @@ -169,10 +169,11 @@ modal.querySelectorAll(SELECTOR_MODAL_RESULTS).forEach((link) => link.addEventListener('click', handleModalResultsClick, false)); - const loop = function loop() { - global.setTimeout(() => { - getNotificationsStatus().then(() => loop()); - }, INTERVAL) - } - getNotificationsStatus().then(() => loop()); + const getNotificationsStatusLoop = () => { + getNotificationsStatus().finally(() => { + global.setTimeout(getNotificationsStatusLoop, INTERVAL); + }); + }; + + getNotificationsStatusLoop(); })(window, window.document, window.ibexa, window.Translator);