From 8451ba2f6eda00ed0866e28e0f1eaa3af8e61acc Mon Sep 17 00:00:00 2001
From: Piotr Gawron <p.gawron@atcomp.pl>
Date: Fri, 17 May 2024 12:10:08 +0200
Subject: [PATCH] don' tcrash app when there is a problem with fetching project
 data

---
 .../Map/MapViewer/utils/config/useOlMapTileLayer.ts         | 2 +-
 src/components/Map/MapViewer/utils/useOlMap.ts              | 6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/components/Map/MapViewer/utils/config/useOlMapTileLayer.ts b/src/components/Map/MapViewer/utils/config/useOlMapTileLayer.ts
index a636c57f..d98b480f 100644
--- a/src/components/Map/MapViewer/utils/config/useOlMapTileLayer.ts
+++ b/src/components/Map/MapViewer/utils/config/useOlMapTileLayer.ts
@@ -46,7 +46,7 @@ export const useOlMapTileLayer = (): BaseLayer => {
         url: sourceUrl,
         maxZoom: mapSize.maxZoom,
         minZoom: mapSize.minZoom,
-        tileSize: mapSize.tileSize,
+        tileSize: Math.max(mapSize.tileSize, 1),
         wrapX: OPTIONS.wrapXInTileLayer,
       }),
     [sourceUrl, mapSize.maxZoom, mapSize.minZoom, mapSize.tileSize],
diff --git a/src/components/Map/MapViewer/utils/useOlMap.ts b/src/components/Map/MapViewer/utils/useOlMap.ts
index 4214f1fd..49ec3002 100644
--- a/src/components/Map/MapViewer/utils/useOlMap.ts
+++ b/src/components/Map/MapViewer/utils/useOlMap.ts
@@ -20,13 +20,7 @@ type UseOlMap = (input?: UseOlMapInput) => UseOlMapOutput;
 export const useOlMap: UseOlMap = ({ target } = {}) => {
   const mapRef = React.useRef<null | HTMLDivElement>(null);
   const { mapInstance, handleSetMapInstance } = useMapInstance();
-  // eslint-disable-next-line no-console
-  console.log('!!!!!!!!!!');
-  // eslint-disable-next-line no-console
-  console.log(mapInstance);
   const view = useOlMapView({ mapInstance });
-  // eslint-disable-next-line no-console
-  console.log(view);
   useOlMapLayers({ mapInstance });
   useOlMapListeners({ view, mapInstance });
 
-- 
GitLab