diff --git a/src/helpers/NotificationsHelper.ts b/src/helpers/NotificationsHelper.ts index d6cded1..fdd7ad6 100644 --- a/src/helpers/NotificationsHelper.ts +++ b/src/helpers/NotificationsHelper.ts @@ -323,8 +323,19 @@ export class NotificationsHelper { // Delete a specific notification const cond = n.hasId ? {id: n.id} : this.NotifToDB(n, false); + // Check for affected users + const users = new Set(); + (await DatabaseHelper.Query({ + table: NOTIFICATIONS_TABLE, + where: cond, + fields: ["dest_user_id"] + })).forEach((row) => users.add(row.dest_user_id)) + // Delete notifications await DatabaseHelper.DeleteRows(NOTIFICATIONS_TABLE, cond); + + // Trigger notifications system + await EventsHelper.Emit("updated_number_notifications", {usersID: [...users]}); } /**