From 5142049de50c02ddc455d15cce832458e2a1060a Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Tue, 19 Aug 2025 04:32:32 +0200 Subject: [PATCH] Fix jwt-token --- client/src/pages/MapView.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/pages/MapView.jsx b/client/src/pages/MapView.jsx index 1092976..88c1248 100644 --- a/client/src/pages/MapView.jsx +++ b/client/src/pages/MapView.jsx @@ -209,7 +209,6 @@ const MapView = () => { const centerLat = (minLat + maxLat) / 2; const centerLon = (minLon + maxLon) / 2; setMapCenter([centerLat, centerLon]); - setIsInitialLoad(false); // Mark that initial load is complete // Disable bounds fitting after a short delay to allow initial fit setTimeout(() => { @@ -217,6 +216,11 @@ const MapView = () => { }, 1000); } } + + // Always mark initial load as complete after first fetch, regardless of device data + if (isInitialLoad) { + setIsInitialLoad(false); + } } catch (error) { console.error('Error fetching devices:', error); } finally {