feat: UserState

This commit is contained in:
2024-04-22 14:38:14 +01:00
parent 5a7657a95d
commit 80a4b5d8e6
103 changed files with 4179 additions and 1165 deletions

View File

@ -70,8 +70,7 @@ export class KeyedReplaceableNoteStore extends HookedNoteStore {
ev.forEach(a => {
const keyOnEvent = this.#keyFn(a);
const existing = this.#events.get(keyOnEvent);
const existingCreated = existing?.created_at ?? 0;
if (a.created_at > existingCreated) {
if (a.created_at > (existing?.created_at ?? 0)) {
if (existing) {
a.relays = dedupe([...existing.relays, ...a.relays]);
}