Speed up loading
This commit is contained in:
@@ -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]}]),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user