From 9ee1f7b57c1d10c9e7646d6188295659478775a0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 May 2024 11:07:30 +0200 Subject: [PATCH] Don't mark as ready already read notifications --- server/core/models/user/user-notification.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/core/models/user/user-notification.ts b/server/core/models/user/user-notification.ts index 2765dbf2a..28a5bb894 100644 --- a/server/core/models/user/user-notification.ts +++ b/server/core/models/user/user-notification.ts @@ -290,7 +290,8 @@ export class UserNotificationModel extends SequelizeModel userId, id: { [Op.in]: notificationIds - } + }, + read: false } } @@ -298,7 +299,7 @@ export class UserNotificationModel extends SequelizeModel } static markAllAsRead (userId: number) { - const query = { where: { userId } } + const query = { where: { userId, read: false } } return UserNotificationModel.update({ read: true }, query) }