ticker fix

This commit is contained in:
Luna D. 2024-05-31 20:14:32 +02:00
parent a3c6cba47e
commit 23c1a3d565
No known key found for this signature in database
GPG key ID: 4B1C63448394F688

View file

@ -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);