modify existing by index
This commit is contained in:
parent
064cb36509
commit
0e7aefb036
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user