From 17361f3014abe2605e0c122db12b61d4b1f996cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alice=20R=C3=BChl?= Date: Wed, 6 Nov 2024 12:32:24 +0100 Subject: [PATCH] Console logging while debugging, please revert --- .../components/common/map/controls/aoi/custom-aoi-control.tsx | 2 ++ app/scripts/components/common/map/controls/hooks/use-aois.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/app/scripts/components/common/map/controls/aoi/custom-aoi-control.tsx b/app/scripts/components/common/map/controls/aoi/custom-aoi-control.tsx index 8abe1427b..0078626ce 100644 --- a/app/scripts/components/common/map/controls/aoi/custom-aoi-control.tsx +++ b/app/scripts/components/common/map/controls/aoi/custom-aoi-control.tsx @@ -88,9 +88,11 @@ function CustomAoI({ // Needed so that this component re-renders to when the draw selection changes // from feature to point. const [, forceUpdate] = useState(0); + console.log("selectedForEditing:", selectedForEditing); useEffect(() => { const mbDraw = map?._drawControl; if (!mbDraw) return; + console.log("use Effect is not triggered! selectedForEditing:", selectedForEditing); const aoiSelectedFor = selectedForEditing ? SIMPLE_SELECT : STATIC_MODE; mbDraw.changeMode(aoiSelectedFor); const onSelChange = () => forceUpdate(Date.now()); diff --git a/app/scripts/components/common/map/controls/hooks/use-aois.ts b/app/scripts/components/common/map/controls/hooks/use-aois.ts index 7a66b558c..048b39a43 100644 --- a/app/scripts/components/common/map/controls/hooks/use-aois.ts +++ b/app/scripts/components/common/map/controls/hooks/use-aois.ts @@ -58,6 +58,7 @@ export default function useAois() { const onSelectionChange = useCallback( (e) => { + console.log('onSelectionChange:', e); const selectedIds = e.features.map((f) => toAoIid(f.id)); aoiSetSelected(selectedIds); },