Debounce search

This commit is contained in:
Jon Staab
2025-11-25 11:55:32 -08:00
parent 64c77cfd13
commit 229d92055f
4 changed files with 18 additions and 15 deletions
+4 -4
View File
@@ -10,8 +10,8 @@ import {
profiles,
searchProfiles,
handlesByNip05,
maxWot,
wotGraph,
getMaxWot,
getWotGraph,
} from "@welshman/app"
import type {FileAttributes} from "@welshman/editor"
import {Editor, MentionSuggestion, WelshmanExtension} from "@welshman/editor"
@@ -62,10 +62,10 @@ export const makeEditor = async ({
onSearch: searchProfiles,
getValue: (profile: PublishedProfile) => profile.event.pubkey,
sortFn: ({score = 1, item}) => {
const wotScore = wotGraph.get().get(item.event.pubkey) || 0
const wotScore = getWotGraph().get(item.event.pubkey) || 0
const membershipScale = $spaceMembers.includes(item.event.pubkey) ? 2 : 1
return dec(score) * inc(wotScore / maxWot.get()) * membershipScale
return dec(score) * inc(wotScore / getMaxWot()) * membershipScale
},
fuseOptions: {
keys: [