diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index a359a8f2bc..c6a35be367 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -301,6 +301,13 @@ export const EntityListProvider = ( }; } + // No filters registered yet — wait for filter components to + // call updateFilters before making the first request. + if (compacted.length === 0 && lastFetchParamsRef.current === undefined) { + setLoading(false); + return; + } + if (isEqual(fetchParams, lastFetchParamsRef.current)) { return; } @@ -351,7 +358,7 @@ export const EntityListProvider = ( // to replace the state rather than pushing, since we don't want // there to be back/forward slots for every single filter change. useEffect(() => { - if (!isMounted()) { + if (!isMounted() || Object.keys(requestedFilters).length === 0) { return; } const queryParams = Object.keys(requestedFilters).reduce((params, key) => {