From 4980bafc62880a396576a6c87d49618ba244f8a8 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 28 Feb 2023 20:51:11 +0200 Subject: [PATCH] fix duplicate notifs --- files/routes/notifications.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/files/routes/notifications.py b/files/routes/notifications.py index a45a8b147..ec0f7a23d 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -353,7 +353,8 @@ def notifications(v:User): total.extend(listing) - listing2 = [] + listing2 = {} + for x in listing: if x.parent_comment_id: parent = x.parent_comment @@ -363,10 +364,11 @@ def notifications(v:User): for y in parent.replies2: if y.replies2 == None: y.replies2 = [] - listing2.append(parent) + listing2[parent] = '' else: - listing2.append(x) - listing = listing2 + listing2[x] = '' + + listing = listing2.keys() total.extend(listing)