From f298d134ac00e034b62fea3a0817079e1da49f6f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Jul 2022 21:33:26 +0200 Subject: [PATCH] make "clear all notifications" button also clear post notifs --- files/routes/notifications.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 797bf550f..22727e5bf 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -2,7 +2,7 @@ from files.helpers.wrappers import * from files.helpers.get import * from files.helpers.const import * from files.__main__ import app - +import time @app.post("/clear") @auth_required @@ -11,6 +11,8 @@ def clear(v): for n in notifs: n.read = True g.db.add(n) + v.last_viewed_post_notifs = int(time.time()) + g.db.add(v) return {"message": "Notifications cleared!"}