From 6be1d986cdb4e75549de4352b3721bd9be631c67 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 21 Feb 2024 18:45:24 +0000 Subject: [PATCH] if (notesToRead.size > 0) --- .../backend/src/core/entities/NotificationEntityService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts index e10b68df02..cc40a3f754 100644 --- a/packages/backend/src/core/entities/NotificationEntityService.ts +++ b/packages/backend/src/core/entities/NotificationEntityService.ts @@ -237,7 +237,9 @@ export class NotificationEntityService implements OnModuleInit { } return acc; }, new Set>()); - trackPromise(this.noteReadService.read(meId, Array.from(notesToRead))); + if (notesToRead.size > 0) { + trackPromise(this.noteReadService.read(meId, Array.from(notesToRead))); + } } catch (e) { // console.error('error thrown by NoteReadService.read', e); }