forked from FoundKeyGang/FoundKey
server: only add unique cascade-delete notes
This commit is contained in:
parent
899b01a031
commit
f3c38ad5c8
1 changed files with 3 additions and 0 deletions
|
@ -105,6 +105,9 @@ async function findCascadingNotes(note: Note): Promise<Note[]> {
|
||||||
});
|
});
|
||||||
|
|
||||||
await Promise.all(replies.map(reply => {
|
await Promise.all(replies.map(reply => {
|
||||||
|
// only add unique notes
|
||||||
|
if (cascadingNotes.find((x) => x.id == reply.id) != null) return;
|
||||||
|
|
||||||
cascadingNotes.push(reply);
|
cascadingNotes.push(reply);
|
||||||
return recursive(reply.id);
|
return recursive(reply.id);
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue