remove trailing period from query term in `useActorAutocompleteQuery` (#3765)

* remove trailing period from query term

* Rm useMemo

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
zio/stable
Hailey 2024-05-06 14:04:47 -07:00 committed by GitHub
parent b4015d10d1
commit fdb5ffff53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -24,7 +24,11 @@ export function useActorAutocompleteQuery(
const moderationOpts = useModerationOpts()
const {getAgent} = useAgent()
prefix = prefix.toLowerCase()
prefix = prefix.toLowerCase().trim()
if (prefix.endsWith('.')) {
// Going from "foo" to "foo." should not clear matches.
prefix = prefix.slice(0, -1)
}
return useQuery<AppBskyActorDefs.ProfileViewBasic[]>({
staleTime: STALE.MINUTES.ONE,