diff options
author | Mario <mario@mariovavti.com> | 2024-12-21 12:07:31 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-12-21 12:07:31 +0000 |
commit | b1f2f67a047e1c595ff2a2a7b4a571c72fdcde6d (patch) | |
tree | 2d975d09e81f110cb61a0d2f685ef29ef0e2a30b | |
parent | bd10c1e40af899b4387c72d484444f85c7e8d654 (diff) | |
download | volse-hubzilla-b1f2f67a047e1c595ff2a2a7b4a571c72fdcde6d.tar.gz volse-hubzilla-b1f2f67a047e1c595ff2a2a7b4a571c72fdcde6d.tar.bz2 volse-hubzilla-b1f2f67a047e1c595ff2a2a7b4a571c72fdcde6d.zip |
better pubs notofication fiy and also fix a javascript error and remove last bit of jquery from notifications
-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 |