DOCS+FE+BE: cleanup, SSE wait for app initialization #1440

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-02-01 10:36:31 +11:00
parent f52a7c112a
commit 4c9c89050b
5 changed files with 28 additions and 7 deletions

View File

@@ -231,7 +231,7 @@ def get_unread_notifications():
notifications = json.load(f)
unread = [n for n in notifications if n.get("read", 0) == 0]
return jsonify(unread)
return unread
def mark_notification_as_read(guid=None, max_attempts=3):
@@ -283,6 +283,13 @@ def mark_notification_as_read(guid=None, max_attempts=3):
return {"success": False, "error": error_msg}
def update_unread_notifications_count():
"""
Re-broadcast unread notifications for the frontend .
"""
broadcast_unread_notifications_count(len(get_unread_notifications()))
def delete_notification(guid):
"""
Delete a notification from the notifications file based on its GUID.