feat: Meldungen in in Iso Chart
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import React, { useEffect } from "react";
|
||||
import ReactModal from "react-modal";
|
||||
import IsoMeasurementChart from "./IsoMeasurementChart";
|
||||
import IsoChartActionBar from "./IsoChartActionBar";
|
||||
import IsoChartActionBar, { useIsoDataLoader } from "./IsoChartActionBar";
|
||||
import Report from "./Report";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { AppDispatch } from "@/redux/store";
|
||||
@@ -36,6 +36,7 @@ const IsoChartView: React.FC<IsoChartViewProps> = ({
|
||||
slotIndex,
|
||||
}) => {
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
const { loadData } = useIsoDataLoader();
|
||||
|
||||
const { isFullScreen, chartTitle } = useSelector(
|
||||
(state: RootState) => state.kabelueberwachungChartSlice
|
||||
@@ -92,8 +93,18 @@ const IsoChartView: React.FC<IsoChartViewProps> = ({
|
||||
|
||||
// Set default to Messkurve
|
||||
dispatch(setChartTitle("Messkurve"));
|
||||
|
||||
// Automatisch Daten laden nach kurzer Verzögerung
|
||||
// um sicherzustellen, dass alle Redux-States gesetzt sind
|
||||
const timer = setTimeout(() => {
|
||||
loadData();
|
||||
}, 100);
|
||||
|
||||
// Cleanup timer
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [isOpen, slotIndex, dispatch]);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isOpen, slotIndex, dispatch]); // loadData bewusst ausgelassen um Endlosschleife zu vermeiden
|
||||
|
||||
return (
|
||||
<ReactModal
|
||||
|
||||
Reference in New Issue
Block a user