diff --git a/src/storages/UserStore.ts b/src/storages/UserStore.ts index f9cc068d..615e2afd 100644 --- a/src/storages/UserStore.ts +++ b/src/storages/UserStore.ts @@ -5,12 +5,10 @@ import { getTagSet } from '@/tags.ts'; export class UserStore implements NStore { private store: NStore; private pubkey: string; - private muteList: Promise; constructor(pubkey: string, store: NStore) { this.pubkey = pubkey; this.store = store; - this.muteList = this.getMuteList(); } async event(event: NostrEvent, opts?: { signal?: AbortSignal }): Promise { @@ -24,7 +22,7 @@ export class UserStore implements NStore { async query(filters: NostrFilter[], opts: { signal?: AbortSignal; limit?: number } = {}): Promise { const allEvents = await this.store.query(filters, opts); - const mutedPubkeysEvent = await this.muteList; + const mutedPubkeysEvent = await this.getMuteList(); if (!mutedPubkeysEvent) { return allEvents; } @@ -36,10 +34,7 @@ export class UserStore implements NStore { } private async getMuteList(): Promise { - const [muteList] = await this.query([{ authors: [this.pubkey], kinds: [10000], limit: 1 }], { - signal: AbortSignal.timeout(5000), - limit: 1, - }); + const [muteList] = await this.store.query([{ authors: [this.pubkey], kinds: [10000], limit: 1 }]); return muteList; } }