Skip to content

Commit

Permalink
Add missing onboardingFlow dep when fetching hasData
Browse files Browse the repository at this point in the history
  • Loading branch information
iblancof committed Oct 18, 2024
1 parent bdc324b commit 52a4967
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ export const InfraPageTemplate = ({
const { error: dataViewLoadError, refetch: loadDataView } = useMetricsDataViewContext();
const { remoteClustersExist } = source?.status ?? {};

const { data, status } = useFetcher(async (callApi) => {
if (!onboardingFlow) return;
return await callApi<GetHasDataResponse>('/api/metrics/source/hasData', {
method: 'GET',
query: {
modules: dataAvailabilityModules,
},
});
});
const { data, status } = useFetcher(
async (callApi) => {
if (!onboardingFlow) return;
return await callApi<GetHasDataResponse>('/api/metrics/source/hasData', {
method: 'GET',
query: {
modules: dataAvailabilityModules,
},
});
},
[onboardingFlow, dataAvailabilityModules]
);

const hasData = !!data?.hasData;
const noDataConfig = getNoDataConfig({
Expand Down

0 comments on commit 52a4967

Please sign in to comment.