From 293e6ae7a2c7d2c88fa699febf94ac47d1f5ec8f Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 8 Apr 2021 12:55:47 +0200 Subject: [PATCH] Hide maintenance icon when the maintenance is over --- www/common/toolbar.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 07eda5b2e..e2ad32ea6 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -1045,6 +1045,7 @@ MessengerUI, Messages) { ]), null, true); }); + var to; Common.makeUniversal('broadcast', { onEvent: function (obj) { var cmd = obj.ev; @@ -1053,13 +1054,25 @@ MessengerUI, Messages) { if (!data) { return void $notif.hide(); } + if ((+new Date()) > data.end) { + return void $notif.hide(); + } m = data; + clearTimeout(to); + to = setTimeout(function () { + m = undefined; + $notif.hide(); + }, m.end-(+new Date())); $notif.css('display', ''); } }); if (m && m.start && m.end) { $notif.css('display', ''); + to = setTimeout(function () { + m = undefined; + $notif.hide(); + }, m.end-(+new Date())); } else { $notif.hide(); }