fix: dedupe people pubkey lists to prevent keyed each duplicate crash
This commit is contained in:
@@ -259,8 +259,9 @@ export const pubkeyLink = (pubkey: string, relays = Router.get().FromPubkeys([pu
|
|||||||
export const bootstrapPubkeys = derived(userFollowList, $userFollowList => {
|
export const bootstrapPubkeys = derived(userFollowList, $userFollowList => {
|
||||||
const appPubkeys = DEFAULT_PUBKEYS.split(",")
|
const appPubkeys = DEFAULT_PUBKEYS.split(",")
|
||||||
const userPubkeys = shuffle(getPubkeyTagValues(getListTags($userFollowList)))
|
const userPubkeys = shuffle(getPubkeyTagValues(getListTags($userFollowList)))
|
||||||
|
const mergedPubkeys = userPubkeys.length > 5 ? userPubkeys : [...userPubkeys, ...appPubkeys]
|
||||||
|
|
||||||
return userPubkeys.length > 5 ? userPubkeys : [...userPubkeys, ...appPubkeys]
|
return uniq(mergedPubkeys)
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deriveEvent = makeDeriveEvent({
|
export const deriveEvent = makeDeriveEvent({
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
const search = debounce(200, (term: string) => {
|
const search = debounce(200, (term: string) => {
|
||||||
if (term) {
|
if (term) {
|
||||||
pubkeys = $profileSearch.searchValues(term)
|
pubkeys = Array.from(new Set($profileSearch.searchValues(term)))
|
||||||
} else {
|
} else {
|
||||||
pubkeys = $bootstrapPubkeys
|
pubkeys = Array.from(new Set($bootstrapPubkeys))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user