From a29bc164aeff58366f8ffc7dc6fe8de098158ecb Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sun, 13 Oct 2024 16:28:10 +0200 Subject: [PATCH] fix for static layers --- src/Components/Map/hooks/useItems.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Map/hooks/useItems.tsx b/src/Components/Map/hooks/useItems.tsx index 06500f15..6a1f2ff2 100644 --- a/src/Components/Map/hooks/useItems.tsx +++ b/src/Components/Map/hooks/useItems.tsx @@ -40,7 +40,6 @@ function useItemsManager(initialItems: Item[]): { const addLayer = useAddLayer(); - const [itemsCount, setItemsCount] = useState(0); const [allItemsLoaded, setallItemsLoaded] = useState(false); @@ -96,6 +95,7 @@ function useItemsManager(initialItems: Item[]): { }, []) const setItemsData = useCallback((layer: LayerProps) => { + addLayer(layer); layer.data?.map(item => { dispatch({ type: "ADD", item: { ...item, layer: layer } }); })