diff --git a/packages/libs/eda/src/lib/map/analysis/mapTypes/plugins/BubbleMarkerMapType.tsx b/packages/libs/eda/src/lib/map/analysis/mapTypes/plugins/BubbleMarkerMapType.tsx index f4c0f52bb0..4c311709be 100644 --- a/packages/libs/eda/src/lib/map/analysis/mapTypes/plugins/BubbleMarkerMapType.tsx +++ b/packages/libs/eda/src/lib/map/analysis/mapTypes/plugins/BubbleMarkerMapType.tsx @@ -595,11 +595,6 @@ function useMarkerData(props: DataProps) { const { numeratorValues, denominatorValues } = configuration; - const disabled = - numeratorValues?.length === 0 || - denominatorValues?.length === 0 || - !validateProportionValues(numeratorValues, denominatorValues); - const studyEntities = useStudyEntities(); const dataClient = useDataClient(); @@ -639,6 +634,13 @@ function useMarkerData(props: DataProps) { }; const { data: legendData } = useLegendData(props); + // add to check legendData is undefined for refetch + const disabled = + numeratorValues?.length === 0 || + denominatorValues?.length === 0 || + !validateProportionValues(numeratorValues, denominatorValues) || + legendData == null; + // FIXME Don't make dependent on legend data return useQuery({ queryKey: ['bubbleMarkers', 'markerData', markerRequestParams],