fix: Leistung etwas verbessert wegen Kabelstrecken anzeigen und ausblenden
This commit is contained in:
@@ -5,6 +5,13 @@ import { createSlice } from "@reduxjs/toolkit";
|
||||
// Thunk to initialize polyline visibility from localStorage using mapId/userId from URL
|
||||
export const initializePolylineFromLocalStorageThunk = () => dispatch => {
|
||||
try {
|
||||
// Prüfe globales Nutzer-Flag
|
||||
if (typeof window !== "undefined" && window.userToggledPolyline) {
|
||||
console.log(
|
||||
"[Redux] Initialisierung abgebrochen: Nutzer hat Polyline bereits manuell geändert."
|
||||
);
|
||||
return;
|
||||
}
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const mapId = params.get("m");
|
||||
const userId = params.get("u");
|
||||
@@ -60,6 +67,12 @@ const polylineLayerVisibleSlice = createSlice({
|
||||
},
|
||||
initializePolylineFromLocalStorage: (state, action) => {
|
||||
// Diese Action wird nur beim Initialisieren aus localStorage verwendet
|
||||
if (typeof window !== "undefined" && window.userToggledPolyline) {
|
||||
console.log(
|
||||
"[Redux] Initialisierung im Reducer abgebrochen: Nutzer hat Polyline bereits manuell geändert."
|
||||
);
|
||||
return;
|
||||
}
|
||||
state.visible = action.payload;
|
||||
state.isInitialized = true;
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user