diff --git a/public/src/components/map/DrawingHandler.tsx b/public/src/components/map/DrawingHandler.tsx
index 5df0255..9c85e37 100644
--- a/public/src/components/map/DrawingHandler.tsx
+++ b/public/src/components/map/DrawingHandler.tsx
@@ -8,9 +8,10 @@ import { CABLE_COLORS, type CableType } from '../../types/mapItem';
interface DrawingHandlerProps {
mapId: string;
onItemCreated: () => void;
+ refreshTrigger?: number;
}
-export function DrawingHandler({ mapId, onItemCreated }: DrawingHandlerProps) {
+export function DrawingHandler({ mapId, onItemCreated, refreshTrigger }: DrawingHandlerProps) {
const { activeTool, isDrawing, drawingPoints, setIsDrawing, addDrawingPoint, resetDrawing } =
useDrawingStore();
const { showToast } = useUIStore();
@@ -36,7 +37,7 @@ export function DrawingHandler({ mapId, onItemCreated }: DrawingHandlerProps) {
}
};
loadItems();
- }, [mapId]);
+ }, [mapId, refreshTrigger]);
// Find nearby device for snapping (exclude info markers)
const findNearbyDevice = (lat: number, lng: number, radiusMeters = 2.5): any | null => {
diff --git a/public/src/components/map/MapView.tsx b/public/src/components/map/MapView.tsx
index 5c64569..acd58b0 100644
--- a/public/src/components/map/MapView.tsx
+++ b/public/src/components/map/MapView.tsx
@@ -99,7 +99,7 @@ export function MapView({ mapId, activeLayer, mapLayers, showShareDialog = false
{/* Drawing handler for creating new items - disabled for read-only */}
{permission !== 'read' && (
-
+
)}
{/* Render existing map items */}
diff --git a/public/src/pages/SharedMap.tsx b/public/src/pages/SharedMap.tsx
index d3bf862..32d5e69 100644
--- a/public/src/pages/SharedMap.tsx
+++ b/public/src/pages/SharedMap.tsx
@@ -242,7 +242,7 @@ export function SharedMap() {
{/* Drawing handler for edit access */}
{!isReadOnly && (
-
+
)}
{/* Render existing map items */}