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
parent
b4015d10d1
commit
fdb5ffff53
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue