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