fix: ChartSwitcher bei Schließen vollständig zurückgesetzt

- Datum auf letzten 30 Tage zurückgesetzt
- Dropdowns auf "Alle Messwerte" und "Isolationswiderstand" zurückgesetzt
- Chart-Titel ebenfalls zurückgesetzt
This commit is contained in:
Ismail Ali
2025-04-09 20:43:35 +02:00
parent 4d357d4440
commit 169271144d
2 changed files with 11 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ import { useLoopChartLoader } from "./LoopMeasurementChart/LoopChartActionBar";
import {
setVonDatum,
setBisDatum,
setSelectedMode,
setSelectedSlotType,
} from "../../../../../redux/slices/kabelueberwachungChartSlice";
interface ChartSwitcherProps {
@@ -52,18 +54,25 @@ const ChartSwitcher: React.FC<ChartSwitcherProps> = ({
// **Modal schließen + Redux-Status zurücksetzen**
const handleClose = () => {
// Zeitbereich zurücksetzen
const today = new Date();
const thirtyDaysAgo = new Date();
thirtyDaysAgo.setDate(today.getDate() - 30);
const toISO = (date: Date) => date.toLocaleDateString("sv-SE");
// Reset Datum
dispatch(setVonDatum(toISO(thirtyDaysAgo)));
dispatch(setBisDatum(toISO(today)));
// Reset Dropdowns
dispatch(setSelectedMode("DIA0"));
dispatch(setSelectedSlotType("isolationswiderstand"));
// Sonstiges Reset
dispatch(setChartOpen(false));
dispatch(setFullScreen(false));
dispatch(resetBrushRange());
onClose();
};

View File

@@ -6,5 +6,5 @@
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
*/
const webVersion = "1.6.218";
const webVersion = "1.6.219";
export default webVersion;