diff --git a/components/mainComponent/MapComponent.js b/components/mainComponent/MapComponent.js index 447b0b211..bd579ff95 100644 --- a/components/mainComponent/MapComponent.js +++ b/components/mainComponent/MapComponent.js @@ -1107,7 +1107,8 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { console.warn("⚠️ Fehler mit `contextmenu` erkannt - Neuladen der Seite."); setTimeout(() => { window.location.reload(); - }, 2000); // **Seite nach 2 Sekunden neu laden** + }, 0); // **Seite nach Sekunde neu laden** + return true; // **Fehler unterdrücken, damit React ihn nicht anzeigt** } }; diff --git a/config/appVersion.js b/config/appVersion.js index 98a0d9bbe..c2cb28618 100644 --- a/config/appVersion.js +++ b/config/appVersion.js @@ -1,2 +1,2 @@ // /config/appVersion -export const APP_VERSION = "1.1.44"; +export const APP_VERSION = "1.1.45"; diff --git a/utils/polylines/setupPolylines.js b/utils/polylines/setupPolylines.js index 6a13d18d8..75e34bb09 100644 --- a/utils/polylines/setupPolylines.js +++ b/utils/polylines/setupPolylines.js @@ -305,10 +305,10 @@ export const setupPolylines = (map, linePositions, lineColors, tooltipContents, const link = `${process.env.NEXT_PUBLIC_BASE_URL}cpl.aspx?ver=35&kue=24&id=${lineData.idLD}`; // console.log("Link der Linie:", link); }); - + // error TypeError: Cannot read properties of null (reading 'contextmenu') wenn der Mas auf die Linie bleibt polyline.on("mouseout", (e) => { polyline.setStyle({ weight: 3 }); - // console.log("🚀 Maus hat die Polyline verlassen - Warten auf Klick außerhalb des Menüs."); + //console.log("🚀 Maus hat die Polyline verlassen - Warten auf Klick außerhalb des Menüs."); document.addEventListener("click", function handleOutsideClick(event) { if (!event.target.closest(".leaflet-contextmenu")) { @@ -323,7 +323,7 @@ export const setupPolylines = (map, linePositions, lineColors, tooltipContents, } } catch (error) { console.error("❌ Fehler beim Schließen des Kontextmenüs:", error); - window.location.reload(); // **Seite neu laden, wenn ein Fehler auftritt** + // **Seite NICHT sofort neuladen, sondern global unterdrücken lassen** } document.removeEventListener("click", handleOutsideClick);