feat: Recoil-Zustand 'poiLayerVisibleState' durch Redux ersetzt
- Recoil-Zugriffe in MapComponent.js, DataSheet.js, useMapComponentState.js entfernt - Redux Slice poiLayerVisibleSlice eingeführt - Redux Store konfiguriert - Zustand 'visible' wird über Redux verwaltet - CHANGELOG.md auf Version 1.1.82 aktualisiert
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
// hooks/useMapComponentState.js
|
||||
// POI -> Kontextmenü -> POI bearbeiten -> Dropdown Geräteauswahl
|
||||
import { useState, useEffect } from "react";
|
||||
import { useRecoilValue } from "recoil";
|
||||
import { poiLayerVisibleState } from "../redux/slices/poiLayerVisibleSlice";
|
||||
import { useSelector } from "react-redux"; // ✅ Redux statt Recoil
|
||||
import { isMockMode } from "../config/config";
|
||||
|
||||
export const useMapComponentState = () => {
|
||||
@@ -12,7 +11,9 @@ export const useMapComponentState = () => {
|
||||
const [locationDeviceData, setLocationDeviceData] = useState([]);
|
||||
const [priorityConfig, setPriorityConfig] = useState([]);
|
||||
const [menuItemAdded, setMenuItemAdded] = useState(false);
|
||||
const poiLayerVisible = useRecoilValue(poiLayerVisibleState);
|
||||
|
||||
// ✅ Redux: Zustand der Sichtbarkeit des POI-Layers
|
||||
const poiLayerVisible = useSelector((state) => state.poiLayerVisible.visible);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchPoiTypData = async () => {
|
||||
@@ -51,8 +52,6 @@ export const useMapComponentState = () => {
|
||||
try {
|
||||
const protocol = window.location.protocol;
|
||||
const host = window.location.hostname;
|
||||
|
||||
// WebService läuft immer auf Port 80 (kein :port anhängen)
|
||||
const apiBaseUrl = `${protocol}//${host}/talas5/ClientData/WebServiceMap.asmx`;
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
@@ -62,7 +61,6 @@ export const useMapComponentState = () => {
|
||||
console.log("🌐 Geräte-API:", url);
|
||||
|
||||
const response = await fetch(url);
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
setLocationDeviceData(data.Points || []);
|
||||
|
||||
Reference in New Issue
Block a user