fix: duplicate relays
This commit is contained in:
parent
5796892e54
commit
be48c9cc37
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@snort/system-react",
|
||||
"version": "1.2.11",
|
||||
"version": "1.2.12",
|
||||
"description": "React hooks for @snort/system",
|
||||
"main": "dist/index.js",
|
||||
"module": "src/index.ts",
|
||||
@ -17,7 +17,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@snort/shared": "^1.0.14",
|
||||
"@snort/system": "^1.2.11",
|
||||
"@snort/system": "^1.2.12",
|
||||
"react": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -9,6 +9,7 @@
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"inlineSourceMap": true,
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@snort/system",
|
||||
"version": "1.2.11",
|
||||
"version": "1.2.12",
|
||||
"description": "Snort nostr system package",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { SortedMap } from "@snort/shared";
|
||||
import { SortedMap, dedupe } from "@snort/shared";
|
||||
import { EventExt, EventType, TaggedNostrEvent } from ".";
|
||||
import { findTag } from "./utils";
|
||||
import EventEmitter from "eventemitter3";
|
||||
@ -73,7 +73,7 @@ export class KeyedReplaceableNoteStore extends HookedNoteStore {
|
||||
const existingCreated = existing?.created_at ?? 0;
|
||||
if (a.created_at > existingCreated) {
|
||||
if (existing) {
|
||||
a.relays.push(...existing.relays);
|
||||
a.relays = dedupe([...existing.relays, ...a.relays]);
|
||||
}
|
||||
this.#events.set(keyOnEvent, a);
|
||||
changes.push(a);
|
||||
|
Loading…
x
Reference in New Issue
Block a user