- Alle Vorkommen von process.env.NEXT_PUBLIC_DEBUG_LOG entfernt - Debug-Konfiguration erfolgt jetzt ausschließlich über public/config.json - getDebugLog()-Utility überall verwendet - .env-Dateien werden für Debug-Logging nicht mehr benötigt - Alle betroffenen Komponenten, Services und API
20 lines
651 B
JavaScript
20 lines
651 B
JavaScript
// utils/polylines/polylineSubscription.js
|
|
import { store } from "../../redux/store";
|
|
import { closePolylineContextMenu } from "../../redux/slices/polylineContextMenuSlice";
|
|
|
|
export function subscribeToPolylineContextMenu() {
|
|
store.subscribe(() => {
|
|
const state = store.getState(); // Redux-Toolkit empfohlene Methode
|
|
if (state.polylineContextMenu.forceClose) {
|
|
if (getDebugLog()) {
|
|
console.log("🚀 Redux-Event erkannt - Kontextmenü wird geschlossen.");
|
|
}
|
|
store.dispatch(closePolylineContextMenu());
|
|
|
|
if (window.map && window.map.contextmenu) {
|
|
window.map.contextmenu.hide();
|
|
}
|
|
}
|
|
});
|
|
}
|