From fc0ad53916756eb2f18161d812e116790e6c8e2a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 9 Jul 2021 08:36:13 +0200 Subject: [PATCH] defer first poll by 10 seconds, to speed up start race and make sure status app is loaded (to not cause a double load of status app.js) --- notifications/js/notificationajaxpopup.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index d190dbe330..48b29712b1 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -90,7 +90,7 @@ function notifications() { var notification_script = document.getElementById('notifications_script_id'); CURRENT_INTERVAL = POLL_INTERVAL = notification_script && notification_script.getAttribute('data-poll-interval'); - TIMEOUT = this.setTimeout(POLL_INTERVAL || 60); + TIMEOUT = this.setTimeout(10); // defer first poll jQuery('#notificationbell').click(jQuery.proxy(this.display, this)); // add click handler for refreshing Notifications @@ -100,13 +100,10 @@ .click(jQuery.proxy(this.run_notifications, this)); $egwpopup_header.children('.button_right_toggle').attr('title', egw.lang('close')); - // query notifictions now - this.run_notifications(); - this.filter = ''; // total number of notifications this.total = 0; - }; + } notifications.prototype.run_notifications = function () {