From d1aa64dba6d46147b349a952feb64a040d2ce0b5 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Sat, 24 Jul 2021 09:26:38 -0400 Subject: [PATCH] Fixed #340 - Announcements popup shows every time --- js/layer/load.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/layer/load.js b/js/layer/load.js index c2474d0..532befe 100644 --- a/js/layer/load.js +++ b/js/layer/load.js @@ -238,10 +238,13 @@ beestat.layer.load.prototype.decorate_ = function(parent) { beestat.setting('first_run', false); (new beestat.component.modal.newsletter()).render(); } else if ( - last_read_announcement_id === undefined || + beestat.cache.announcement.length > 0 && ( - most_recent_important_announcement_id !== undefined && - last_read_announcement_id < most_recent_important_announcement_id + last_read_announcement_id === undefined || + ( + most_recent_important_announcement_id !== undefined && + last_read_announcement_id < most_recent_important_announcement_id + ) ) ) { (new beestat.component.modal.announcements()).render();