From d8c14eec58a21f1f49f8f3c449a862c0539dd5ee Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 21 Oct 2025 20:52:31 +0000 Subject: [PATCH] fix issue with notification on screen size where notifications are hidden and isVisible would always return false --- boot.php | 2 +- view/tpl/notifications_widget.tpl | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/boot.php b/boot.php index 5b4047ebf..aac38eb22 100644 --- a/boot.php +++ b/boot.php @@ -70,7 +70,7 @@ require_once('include/security.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '10.5.13'); +define('STD_VERSION', '10.5.14'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1264); diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index efb8feaed..c4c38a5fa 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -211,7 +211,7 @@ element.classList.add('active', 'sticky-top'); // Count the visible notifications - let visibleNotifications = Array.from(menu.querySelectorAll('.notification')).filter(isVisible).length; + let visibleNotifications = menu.querySelectorAll('.notification:not(.tt-filter-active):not(.cn-filter-active)').length; // Load more notifications if the visible count is low if (sse_type && sse_offset !== -1 && visibleNotifications < 15) { @@ -304,11 +304,6 @@ }); - // Function to check if an element is visible - function isVisible(el) { - return el.offsetWidth > 0 && el.offsetHeight > 0; - } - function sse_bs_init() { // Check if 'notification_open' exists in sessionStorage or if sse_type is defined if (sessionStorage.getItem('notification_open') !== null || typeof sse_type !== 'undefined') { @@ -494,7 +489,7 @@ // Load more notifications if visible notifications count becomes low if (sse_type && sse_offset !== -1) { let menu = document.getElementById('nav-' + sse_type + '-menu'); - if (menu && Array.from(menu.querySelectorAll('.notification')).filter(isVisible).length < 15) { + if (menu && menu.querySelectorAll('.notification:not(.tt-filter-active):not(.cn-filter-active)').length < 15) { sse_bs_notifications(sse_type, false, true); } } @@ -512,7 +507,7 @@ } {{if $invert_notifications_order}} - if (!replace && !followup && Array.from(notify_menu.querySelectorAll('.notification')).filter(isVisible).length >= 30) { + if (!replace && !followup && notify_menu.querySelectorAll('.notification:not(.tt-filter-active):not(.cn-filter-active)').length >= 30) { return; } {{/if}} @@ -621,7 +616,7 @@ function sse_setNotificationsStatus(data, all_notifications) { let primary_notifications = ['dm', 'home', 'intros', 'register', 'notify', 'files']; - let secondary_notifications = ['network', 'forums', 'all_events', 'pubs']; + let secondary_notifications = ['network', 'all_events', 'pubs']; if (!all_notifications) { all_notifications = primary_notifications.concat(secondary_notifications);