From daa0a3a8e81188a4f1c3cee3f5645e03b3867b39 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sun, 13 Oct 2024 01:04:12 +0200 Subject: [PATCH] fixed useItems for static data --- src/Components/Map/hooks/useItems.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Components/Map/hooks/useItems.tsx b/src/Components/Map/hooks/useItems.tsx index 7ff0f81c..06500f15 100644 --- a/src/Components/Map/hooks/useItems.tsx +++ b/src/Components/Map/hooks/useItems.tsx @@ -1,6 +1,6 @@ -import { useCallback, useReducer, createContext, useContext, useEffect, useState } from "react"; +import { useCallback, useReducer, createContext, useContext, useState } from "react"; import * as React from "react"; -import { Item, ItemsApi, LayerProps, Tag } from "../../../types"; +import { Item, LayerProps } from "../../../types"; import { toast } from "react-toastify"; import { useAddLayer } from "./useLayers"; @@ -99,6 +99,7 @@ function useItemsManager(initialItems: Item[]): { layer.data?.map(item => { dispatch({ type: "ADD", item: { ...item, layer: layer } }); }) + setallItemsLoaded(true); }, []);