From 951ffd24d6340253b2537b711488611ac220f9d2 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Tue, 20 Feb 2024 17:29:45 +0100 Subject: [PATCH] fixed layer control not working properly when clicking on labels --- .../Map/Subcomponents/Controls/LayerControl.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Components/Map/Subcomponents/Controls/LayerControl.tsx b/src/Components/Map/Subcomponents/Controls/LayerControl.tsx index 523d3744..6c7c89f8 100644 --- a/src/Components/Map/Subcomponents/Controls/LayerControl.tsx +++ b/src/Components/Map/Subcomponents/Controls/LayerControl.tsx @@ -14,7 +14,6 @@ export function LayerControl() { layers.map(layer => addVisibleLayer(layer) ) - }, [layers]) const isLayerVisible = useIsLayerVisible(); @@ -22,26 +21,24 @@ export function LayerControl() { const addVisibleLayer = useAddVisibleLayer(); return ( -
e.stopPropagation()}> +
{ open ? -
e.stopPropagation()}> -