Fix inbox relays, add time functions
This commit is contained in:
@@ -9,7 +9,7 @@ import {repository, load} from './core'
|
||||
import {createSearch} from './util'
|
||||
import {collection} from './collection'
|
||||
import {loadRelaySelections} from './relaySelections'
|
||||
import {getUserWotScore} from './wot'
|
||||
import {wotGraph} from './wot'
|
||||
|
||||
export const profiles = withGetter(
|
||||
deriveEventsMapped<PublishedProfile>(repository, {
|
||||
@@ -58,8 +58,13 @@ export const profileSearch = derived(profiles, $profiles =>
|
||||
createSearch($profiles, {
|
||||
onSearch: searchProfiles,
|
||||
getValue: (profile: PublishedProfile) => profile.event.pubkey,
|
||||
sortFn: ({score, item}) =>
|
||||
score! < 0.1 ? dec(score!) * getUserWotScore(item.event.pubkey) : -score!,
|
||||
sortFn: ({score, item}) => {
|
||||
if (score && score > 0.1) return -score!
|
||||
|
||||
const wotScore = wotGraph.get().get(item.event.pubkey) || 0
|
||||
|
||||
return score ? dec(score) * wotScore : -wotScore
|
||||
},
|
||||
fuseOptions: {
|
||||
keys: ["name", "display_name", {name: "about", weight: 0.3}],
|
||||
threshold: 0.3,
|
||||
|
||||
Reference in New Issue
Block a user