From f5c6bd41f1a9ffa1b2b8ad5973793086bdbe805f Mon Sep 17 00:00:00 2001 From: "Dae Kun (DK) Kwon" Date: Mon, 6 Nov 2023 22:17:21 -0500 Subject: [PATCH] fix initial bubble marker bug --- .../mapTypes/plugins/BubbleMarkerMapType.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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],