Speed up loading

This commit is contained in:
Jon Staab
2025-04-07 16:13:13 -07:00
parent 7fe58f4bdf
commit 7cb8033334
9 changed files with 103 additions and 103 deletions
+3 -9
View File
@@ -6,7 +6,7 @@ import {repository} from "./core.js"
import {Router} from "./router.js"
import {collection} from "./collection.js"
import {ensurePlaintext} from "./plaintext.js"
import {loadRelaySelections} from "./relaySelections.js"
import {loadWithAsapMetaRelayUrls} from "./relaySelections.js"
export const mutes = deriveEventsMapped<PublishedList>(repository, {
filters: [{kinds: [MUTES]}],
@@ -27,12 +27,6 @@ export const {
name: "mutes",
store: mutes,
getKey: mute => mute.event.pubkey,
load: async (pubkey: string, request: Partial<MultiRequestOptions> = {}) => {
await loadRelaySelections(pubkey, request)
const filters = [{kinds: [MUTES], authors: [pubkey]}]
const relays = Router.get().FromPubkey(pubkey).getUrls()
await load({relays, ...request, filters})
},
load: (pubkey: string, relays: string[]) =>
loadWithAsapMetaRelayUrls(pubkey, relays, [{kinds: [MUTES], authors: [pubkey]}]),
})