From 629bb5ca41f048f67bcf8194ba751b1c336ff5d8 Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 26 Apr 2024 18:56:25 -0700 Subject: [PATCH] show spinner when fetching pt 2 --- src/view/shell/desktop/Search.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/view/shell/desktop/Search.tsx b/src/view/shell/desktop/Search.tsx index 92eeb5ea11..92fe056464 100644 --- a/src/view/shell/desktop/Search.tsx +++ b/src/view/shell/desktop/Search.tsx @@ -30,7 +30,6 @@ import {precacheProfile} from 'state/queries/profile' import {Link} from '#/view/com/util/Link' import {UserAvatar} from '#/view/com/util/UserAvatar' import {Text} from 'view/com/util/text/Text' -import {useThrottledValue} from '#/components/hooks/useThrottledValue' export const MATCH_HANDLE = /@?([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*(?:\.[a-zA-Z]{2,}))/ @@ -152,12 +151,10 @@ export function DesktopSearch() { const navigation = useNavigation() const [isActive, setIsActive] = React.useState(false) const [query, setQuery] = React.useState('') - const throttledInput = useThrottledValue(query, 300) const {data: autocompleteData, isFetching} = useActorAutocompleteQuery( - throttledInput, + query, true, ) - const isLoading = isFetching && !autocompleteData?.length const moderationOpts = useModerationOpts() @@ -232,7 +229,7 @@ export function DesktopSearch() { {query !== '' && isActive && moderationOpts && ( - {isLoading ? ( + {isFetching && !autocompleteData?.length ? (