diff --git a/.env.development b/.env.development index 07480498e..dc25ac32b 100644 --- a/.env.development +++ b/.env.development @@ -24,4 +24,4 @@ NEXT_PUBLIC_USE_MOCKS=true # z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen # basePath wird jetzt in public/config.json gepflegt # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.1.338 +NEXT_PUBLIC_APP_VERSION=1.1.339 diff --git a/.env.production b/.env.production index 33a696788..3cfd6abde 100644 --- a/.env.production +++ b/.env.production @@ -25,4 +25,4 @@ NEXT_PUBLIC_USE_MOCKS=false # basePath wird jetzt in public/config.json gepflegt # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.1.338 +NEXT_PUBLIC_APP_VERSION=1.1.339 diff --git a/components/mainComponent/MapComponent.js b/components/mainComponent/MapComponent.js index 2b82c779e..5c7fb6d2d 100644 --- a/components/mainComponent/MapComponent.js +++ b/components/mainComponent/MapComponent.js @@ -97,6 +97,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { const countdownActive = useSelector(state => state.polylineContextMenu.countdownActive); const isPolylineContextMenuOpen = useSelector(state => state.polylineContextMenu.isOpen); const polylineVisible = useSelector(selectPolylineVisible); + const polylineInitialized = useSelector(state => state.polylineLayerVisible.isInitialized); const GisSystemStatic = useSelector(selectGisSystemStatic); // Prüfen, ob TALAS (IdSystem 1) erlaubt ist const isTalasAllowed = Array.isArray(GisSystemStatic) @@ -456,6 +457,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { newCoords, tempMarker, polylineVisible, + polylineInitialized, isTalasAllowed, poiLayerVisible, ]); diff --git a/components/uiWidgets/mapLayersControlPanel/MapLayersControlPanel.js b/components/uiWidgets/mapLayersControlPanel/MapLayersControlPanel.js index 561327fbf..a21835905 100644 --- a/components/uiWidgets/mapLayersControlPanel/MapLayersControlPanel.js +++ b/components/uiWidgets/mapLayersControlPanel/MapLayersControlPanel.js @@ -6,6 +6,7 @@ import { useSelector, useDispatch } from "react-redux"; import { selectPolylineVisible, setPolylineVisible, + initializePolylineFromLocalStorageThunk, } from "@/redux/slices/database/polylines/polylineLayerVisibleSlice"; import { selectGisSystemStatic } from "@/redux/slices/webservice/gisSystemStaticSlice"; import { selectGisStationsStaticDistrict } from "@/redux/slices/webservice/gisStationsStaticDistrictSlice"; @@ -14,6 +15,8 @@ import { setVisible } from "@/redux/slices/database/pois/poiLayerVisibleSlice"; import { incrementZoomTrigger } from "@/redux/slices/zoomTriggerSlice"; function MapLayersControlPanel() { + // Dummy state to force re-render after checkbox click (workaround for Redux/localStorage sync) + const [forceUpdate, setForceUpdate] = useState(0); const [editMode, setEditMode] = useState(false); // Zustand für editMode const [localStorageLoaded, setLocalStorageLoaded] = useState(false); // Tracking ob localStorage geladen wurde const kabelstreckenVisible = useSelector(selectPolylineVisible); // Redux State für Kabelstrecken @@ -41,8 +44,10 @@ function MapLayersControlPanel() { const handlePolylineCheckboxChange = event => { const checked = event.target.checked; dispatch(setPolylineVisible(checked)); - dispatch(setPolylineVisible(checked)); + // Synchronisiere Redux nach localStorage-Update setTimeout(() => { + dispatch(initializePolylineFromLocalStorageThunk()); + setForceUpdate(f => f + 1); // Force re-render const event = new Event("polylineVisibilityChanged"); window.dispatchEvent(event); }, 100); diff --git a/nodemap-1.1.337.zip b/nodemap-1.1.337.zip deleted file mode 100644 index a71f9624a..000000000 Binary files a/nodemap-1.1.337.zip and /dev/null differ diff --git a/package-lock.json b/package-lock.json index 799aa6058..10a98e413 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nodemap", - "version": "1.1.338", + "version": "1.1.339", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nodemap", - "version": "1.1.338", + "version": "1.1.339", "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", diff --git a/package.json b/package.json index 53d390a5b..5d83238e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodemap", - "version": "1.1.338", + "version": "1.1.339", "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0",