refactor: useRestoreMapSettings entfernt und direkt in MapComponent integriert
- redundante Hook gelöscht - restoreMapSettings direkt per useEffect in MapComponent verwendet - mehr Klarheit durch Vereinfachung der Map-Initialisierung
This commit is contained in:
@@ -44,7 +44,6 @@ import { updateCountdown, closePolylineContextMenu } from "../../redux/slices/po
|
|||||||
//-------------------MapComponent.js hooks--------------------
|
//-------------------MapComponent.js hooks--------------------
|
||||||
import useInitializeMap from "./hooks/useInitializeMap";
|
import useInitializeMap from "./hooks/useInitializeMap";
|
||||||
|
|
||||||
import useRestoreMapSettings from "./hooks/useRestoreMapSettings";
|
|
||||||
import { setSelectedPoi } from "../../redux/slices/selectedPoiSlice";
|
import { setSelectedPoi } from "../../redux/slices/selectedPoiSlice";
|
||||||
import { setDisabled } from "../../redux/slices/polylineEventsDisabledSlice";
|
import { setDisabled } from "../../redux/slices/polylineEventsDisabledSlice";
|
||||||
import { setMapId, setUserId } from "../../redux/slices/urlParameterSlice";
|
import { setMapId, setUserId } from "../../redux/slices/urlParameterSlice";
|
||||||
@@ -429,7 +428,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
|||||||
}, [map, linePositions, lineColors, tooltipContents, newPoint, newCoords, tempMarker, polylineVisible]);
|
}, [map, linePositions, lineColors, tooltipContents, newPoint, newCoords, tempMarker, polylineVisible]);
|
||||||
|
|
||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
useRestoreMapSettings(map);
|
|
||||||
//Test in useEffect
|
//Test in useEffect
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (map) {
|
if (map) {
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
import { useEffect } from "react";
|
|
||||||
import { restoreMapSettings } from "../../../utils/mapUtils.js"; // Stelle sicher, dass der Pfad korrekt ist
|
|
||||||
|
|
||||||
const useRestoreMapSettings = (map) => {
|
|
||||||
useEffect(() => {
|
|
||||||
if (map) {
|
|
||||||
restoreMapSettings(map);
|
|
||||||
}
|
|
||||||
}, [map]);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default useRestoreMapSettings;
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
// /config/appVersion
|
// /config/appVersion
|
||||||
export const APP_VERSION = "1.1.154";
|
export const APP_VERSION = "1.1.155";
|
||||||
|
|||||||
Reference in New Issue
Block a user