Skip to content

Commit

Permalink
Trigger global search request (#305)
Browse files Browse the repository at this point in the history
Issue introduced with a457d80.
"FetchedSources" was changed to represent the loading state of the request, but it was forgotten to update its usage
  • Loading branch information
schroda authored May 18, 2023
1 parent aa801a5 commit feac34b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/screens/SearchAll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down Expand Up @@ -116,7 +116,7 @@ const SearchAll: React.FC = () => {
}, [ResetUI]);

useEffect(() => {
if (query && FetchedSources) {
if (query && !isLoadingSources) {
const delayDebounceFn = setTimeout(() => {
setTriggerUpdate(0);
}, 1000);
Expand Down

0 comments on commit feac34b

Please sign in to comment.