From 9b2ea44000ec16d2a80ba539a5fae320e0569595 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 Oct 2025 06:11:24 +0000 Subject: [PATCH] fix regression setting the offset and fix js error if notify_menu is null (can happen when forum notifications are ddisabled) --- boot.php | 2 +- view/tpl/notifications_widget.tpl | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 896de679d..a74436f7c 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.9'); +define('STD_VERSION', '10.5.10'); 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 a14b72149..2c3a5b0a2 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -413,6 +413,11 @@ sse_bs_active = false; sse_rmids = []; document.getElementById("nav-" + sse_type + "-loading").style.display = 'none'; + + if (typeof obj[sse_type] !== 'undefined') { + sse_offset = obj[sse_type].offset; + } + sse_handleNotifications(obj, replace, followup); }) .catch(error => { @@ -485,8 +490,6 @@ sse_setNotificationsStatus(null, all_notifications); if (typeof obj[sse_type] !== 'undefined') { - sse_offset = obj[sse_type].offset; - // Load more notifications if visible notifications count becomes low if (sse_type && sse_offset !== -1) { let menu = document.getElementById('nav-' + sse_type + '-menu'); @@ -503,6 +506,10 @@ let notify_loading = document.getElementById("nav-" + notifyType + "-loading"); let notify_count = document.getElementsByClassName(notifyType + "-update"); + if (notify_menu === null) { + return; + } + if (replace && !followup) { notify_menu.innerHTML = ''; // Clear menu notify_loading.style.display = 'none'; // Hide loading