From f7bd210316fcf203dd29b6ad03e2bf6c9a121aa4 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sun, 16 Apr 2023 13:32:36 +0200 Subject: [PATCH] server: replace Array.find with Array.some --- packages/backend/src/services/note/delete.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend/src/services/note/delete.ts b/packages/backend/src/services/note/delete.ts index 595c28ace..f22ce80db 100644 --- a/packages/backend/src/services/note/delete.ts +++ b/packages/backend/src/services/note/delete.ts @@ -150,7 +150,7 @@ async function findCascadingNotes(note: Note): Promise { await Promise.all(replies.map(reply => { // only add unique notes - if (cascadingNotes.find((x) => x.id === reply.id) != null) return; + if (cascadingNotes.some((x) => x.id === reply.id)) return; cascadingNotes.push(reply); return recursive(reply.id); @@ -186,4 +186,3 @@ async function getMentionedRemoteUsers(note: Note): Promise { where, }) as IRemoteUser[]; } -