server: replace Array.find with Array.some

This commit is contained in:
Johann150 2023-04-16 13:32:36 +02:00
parent ba2b7ef43c
commit f7bd210316
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -150,7 +150,7 @@ async function findCascadingNotes(note: Note): Promise<Note[]> {
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<IRemoteUser[]> {
where,
}) as IRemoteUser[];
}