modify existing by index
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Kieran 2023-08-23 13:22:11 +01:00
parent 064cb36509
commit 0e7aefb036
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -150,9 +150,9 @@ export class FlatNoteStore extends HookedNoteStore<Readonly<Array<TaggedNostrEve
this.#ids.add(a.id);
changes.push(a);
} else {
const existing = this.#events.find(b => b.id === a.id);
if (existing) {
existing.relays = appendDedupe(existing.relays, a.relays);
const existing = this.#events.findIndex(b => b.id === a.id);
if (existing !== -1) {
this.#events[existing].relays = appendDedupe(this.#events[existing].relays, a.relays);
}
}
});