Speed up loading, improve relay selection from filters

This commit is contained in:
Jon Staab
2024-09-04 16:16:14 -07:00
parent 9b44aac584
commit eb1a219ca5
5 changed files with 78 additions and 84 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import {readProfile, displayProfile, displayPubkey, PROFILE} from '@welshman/uti
import {type SubscribeRequest} from "@welshman/net"
import {type PublishedProfile} from "@welshman/util"
import {deriveEventsMapped, withGetter} from '@welshman/store'
import {repository, load} from './core'
import {repository, loadOne} from './core'
import {createSearch} from './util'
import {collection} from './collection'
@@ -24,7 +24,7 @@ export const {
store: profiles,
getKey: profile => profile.event.pubkey,
load: (pubkey: string, request: Partial<SubscribeRequest> = {}) =>
load({...request, filters: [{kinds: [PROFILE], authors: [pubkey]}]}),
loadOne({...request, filters: [{kinds: [PROFILE], authors: [pubkey]}]}),
})
export const profileSearch = derived(profiles, $profiles =>