refactor: entferne veralteten fetch-Block für gisLinesStatus aus MapComponent
- fetch(...) durch Redux-Thunk ersetzt - Daten werden zentral über fetchLineStatusAndLinesThunk bereitgestellt - keine Redundanz oder Datenverluste festgestellt
This commit is contained in:
@@ -362,40 +362,6 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
|||||||
}
|
}
|
||||||
}, [poiTypStatus, dispatch]);
|
}, [poiTypStatus, dispatch]);
|
||||||
|
|
||||||
//--------------------------------------------
|
|
||||||
useEffect(() => {
|
|
||||||
const fetchData = async () => {
|
|
||||||
try {
|
|
||||||
const response1 = await fetch(webserviceGisLinesStatusUrl);
|
|
||||||
const data1 = await response1.json();
|
|
||||||
//console.log("data1.Statis", data1.Statis);
|
|
||||||
const reversedData = data1.Statis.reverse();
|
|
||||||
setLineStatusData(reversedData);
|
|
||||||
|
|
||||||
const response2 = await fetch("/api/talas_v5_DB/gisLines/readGisLines");
|
|
||||||
const data2 = await response2.json();
|
|
||||||
|
|
||||||
const colorsByModule = {};
|
|
||||||
reversedData.forEach((stat) => {
|
|
||||||
if (!Array.isArray(data2)) {
|
|
||||||
console.warn("WARNUNG: gis_lines ist kein Array, wird ignoriert.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const matchingLine = data2.find((item) => item.idLD === stat.IdLD && item.idModul === stat.Modul);
|
|
||||||
|
|
||||||
if (matchingLine) {
|
|
||||||
colorsByModule[matchingLine.idModul] = stat.PrioColor;
|
|
||||||
//console.log("Übereinstimmung gefunden für: ", stat);
|
|
||||||
setLinesData(matchingLine);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//setLineColors(colorsByModule);
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error fetching data:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
fetchData();
|
|
||||||
}, []);
|
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
//Tooltip an mouse position anzeigen für die Linien
|
//Tooltip an mouse position anzeigen für die Linien
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// /config/appVersion
|
// /config/appVersion
|
||||||
export const APP_VERSION = "1.1.132";
|
export const APP_VERSION = "1.1.133";
|
||||||
|
|||||||
Reference in New Issue
Block a user