Trigger global search request (#305)

Issue introduced with a457d80c44.
"FetchedSources" was changed to represent the loading state of the request, but it was forgotten to update its usage
This commit is contained in:
schroda
2023-05-18 22:28:53 +02:00
committed by GitHub
parent aa801a57ee
commit feac34ba83

View File

@@ -46,7 +46,7 @@ const SearchAll: React.FC = () => {
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', sourceDefualtLangs());
const [showNsfw] = useLocalStorage<boolean>('showNsfw', true);
const { data: unsortedSources = [], isLoading: FetchedSources } = requestManager.useGetSourceList();
const { data: unsortedSources = [], isLoading: isLoadingSources } = requestManager.useGetSourceList();
const sources = useMemo(
() =>
unsortedSources.sort((a: { displayName: string }, b: { displayName: string }) => {
@@ -116,7 +116,7 @@ const SearchAll: React.FC = () => {
}, [ResetUI]);
useEffect(() => {
if (query && FetchedSources) {
if (query && !isLoadingSources) {
const delayDebounceFn = setTimeout(() => {
setTriggerUpdate(0);
}, 1000);