fix issue reconnecting cable after removing old cable: error ports full fix
All checks were successful
Build and deploy / Build and Push Docker Images (push) Successful in 2m17s
All checks were successful
Build and deploy / Build and Push Docker Images (push) Successful in 2m17s
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -99,7 +99,7 @@ export function MapView({ mapId, activeLayer, mapLayers, showShareDialog = false
|
||||
|
||||
{/* Drawing handler for creating new items - disabled for read-only */}
|
||||
{permission !== 'read' && (
|
||||
<DrawingHandler mapId={mapId} onItemCreated={handleItemCreated} />
|
||||
<DrawingHandler mapId={mapId} onItemCreated={handleItemCreated} refreshTrigger={refreshTrigger} />
|
||||
)}
|
||||
|
||||
{/* Render existing map items */}
|
||||
|
||||
@@ -242,7 +242,7 @@ export function SharedMap() {
|
||||
|
||||
{/* Drawing handler for edit access */}
|
||||
{!isReadOnly && (
|
||||
<DrawingHandler mapId={mapData.id} onItemCreated={handleItemCreated} />
|
||||
<DrawingHandler mapId={mapData.id} onItemCreated={handleItemCreated} refreshTrigger={refreshTrigger} />
|
||||
)}
|
||||
|
||||
{/* Render existing map items */}
|
||||
|
||||
Reference in New Issue
Block a user