Hide maintenance icon when the maintenance is over

pull/1/head
yflory 4 years ago
parent 3a81e5b75f
commit 293e6ae7a2

@ -1045,6 +1045,7 @@ MessengerUI, Messages) {
]), null, true); ]), null, true);
}); });
var to;
Common.makeUniversal('broadcast', { Common.makeUniversal('broadcast', {
onEvent: function (obj) { onEvent: function (obj) {
var cmd = obj.ev; var cmd = obj.ev;
@ -1053,13 +1054,25 @@ MessengerUI, Messages) {
if (!data) { if (!data) {
return void $notif.hide(); return void $notif.hide();
} }
if ((+new Date()) > data.end) {
return void $notif.hide();
}
m = data; m = data;
clearTimeout(to);
to = setTimeout(function () {
m = undefined;
$notif.hide();
}, m.end-(+new Date()));
$notif.css('display', ''); $notif.css('display', '');
} }
}); });
if (m && m.start && m.end) { if (m && m.start && m.end) {
$notif.css('display', ''); $notif.css('display', '');
to = setTimeout(function () {
m = undefined;
$notif.hide();
}, m.end-(+new Date()));
} else { } else {
$notif.hide(); $notif.hide();
} }

Loading…
Cancel
Save