server: only add unique cascade-delete notes
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
Johann150 2022-11-11 18:08:57 +01:00
parent 899b01a031
commit f3c38ad5c8
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -105,6 +105,9 @@ 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;
cascadingNotes.push(reply);
return recursive(reply.id);
}));