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)
This commit is contained in:
Ralf Becker 2021-07-09 08:36:13 +02:00
parent e03fb45b0e
commit fc0ad53916

View File

@ -90,7 +90,7 @@
function notifications() { function notifications() {
var notification_script = document.getElementById('notifications_script_id'); var notification_script = document.getElementById('notifications_script_id');
CURRENT_INTERVAL = POLL_INTERVAL = notification_script && notification_script.getAttribute('data-poll-interval'); 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)); jQuery('#notificationbell').click(jQuery.proxy(this.display, this));
// add click handler for refreshing Notifications // add click handler for refreshing Notifications
@ -100,13 +100,10 @@
.click(jQuery.proxy(this.run_notifications, this)); .click(jQuery.proxy(this.run_notifications, this));
$egwpopup_header.children('.button_right_toggle').attr('title', egw.lang('close')); $egwpopup_header.children('.button_right_toggle').attr('title', egw.lang('close'));
// query notifictions now
this.run_notifications();
this.filter = ''; this.filter = '';
// total number of notifications // total number of notifications
this.total = 0; this.total = 0;
}; }
notifications.prototype.run_notifications = function () notifications.prototype.run_notifications = function ()
{ {