diff options
-rw-r--r-- | Zotlabs/Module/Sse_bs.php | 6 | ||||
-rw-r--r-- | view/tpl/notifications_widget.tpl | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php index d43548770..d214ba28f 100644 --- a/Zotlabs/Module/Sse_bs.php +++ b/Zotlabs/Module/Sse_bs.php @@ -473,6 +473,7 @@ class Sse_bs extends Controller { if ($notifications) { $items = q("SELECT * FROM item WHERE true $uids + AND created <= '%s' AND obj_type NOT IN ('Document', 'Video', 'Audio', 'Image') AND author_xchan != '%s' AND created > '%s' @@ -481,6 +482,7 @@ class Sse_bs extends Controller { $sql_extra2 $sql_extra3 ORDER BY created DESC LIMIT $limit OFFSET $offset", + dbescdate($_SESSION['sse_loadtime']), dbesc(self::$ob_hash), dbescdate($_SESSION['last_login_date'] ?? $_SESSION['static_loadtime']) ); @@ -500,13 +502,15 @@ class Sse_bs extends Controller { } } - $r = q("SELECT id FROM item + $r = q("SELECT id, body FROM item WHERE true $uids + AND created <= '%s' AND created > '%s' $item_normal $sql_extra $sql_extra3 AND author_xchan != '%s' LIMIT 100", + dbescdate($_SESSION['sse_loadtime']), dbescdate($_SESSION['last_login_date'] ?? $_SESSION['static_loadtime']), dbesc(self::$ob_hash) ); diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 3347378b5..f884ff1f6 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -7,9 +7,9 @@ var sse_fallback_interval; var sse_sys_only = {{$sys_only}}; - $(document).ready(function() { + document.addEventListener("DOMContentLoaded", function() { let notificationsWrapper = document.getElementById('notifications_wrapper'); - let notificationsParent = notificationsWrapper.parentElement.id; + let notificationsParent = notificationsWrapper ? notificationsWrapper.parentElement.id : null; let notificationsBtn = document.querySelector('.notifications-btn'); // Event listener for notifications button |