From 23c1a3d56572b780dfde1235bf0b74c7d2d587e4 Mon Sep 17 00:00:00 2001 From: "Luna D." Date: Fri, 31 May 2024 20:14:32 +0200 Subject: [PATCH] ticker fix --- assets/js/notifications.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/js/notifications.js b/assets/js/notifications.js index 2447debb..04d48f91 100644 --- a/assets/js/notifications.js +++ b/assets/js/notifications.js @@ -60,7 +60,11 @@ function setupNotifications() { setTimeout(getNewNotifications, NOTIFICATION_INTERVAL); // Update the current number of notifications based on the latest page load - storeNotificationCount($('.js-notification-ticker').dataset.notificationCount); + const ticker = $('.js-notification-ticker'); + + if (ticker) { + storeNotificationCount(ticker.dataset.notificationCount); + } // Update ticker when the stored value changes - this will occur in all open tabs store.watch('notificationCount', updateNotificationTicker);