feat: improve mention search results

This commit is contained in:
codytseng
2025-02-03 16:17:14 +08:00
parent faa7298f89
commit 699f3a792d
5 changed files with 47 additions and 8 deletions

View File

@@ -1,4 +1,3 @@
import { SEARCHABLE_RELAY_URLS } from '@/constants'
import { useFeed } from '@/providers/FeedProvider'
import client from '@/services/client.service'
import { TProfile } from '@/types'
@@ -22,13 +21,7 @@ export function useSearchProfiles(search: string, limit: number) {
setIsFetching(true)
setProfiles([])
try {
const profiles = await client.fetchProfiles(
searchableRelayUrls.concat(SEARCHABLE_RELAY_URLS).slice(0, 4),
{
search,
limit
}
)
const profiles = await client.searchProfilesFromIndex(search)
if (profiles) {
setProfiles(profiles)
}