From d0c5c1c34105e630e8260543fde47696bfffbf55 Mon Sep 17 00:00:00 2001 From: ISA Date: Fri, 14 Feb 2025 10:41:53 +0100 Subject: [PATCH] fix:kein doppelte Chart Effekt in einem Modal --- .../Charts/LoopMeasurementChart/LoopChartActionBar.tsx | 10 ++-------- .../kue705FO/Charts/TDRChart/TDRChartActionBar.tsx | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx index a98a995..ae84da8 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx @@ -14,19 +14,13 @@ const LoopChartActionBar: React.FC = () => { const response = await fetch("/mockData.json"); const data = await response.json(); if (Array.isArray(data)) { - // data ist ein Array und kann mit .map() verwendet werden console.log("Daten geladen:", data); + dispatch(setChartData(data)); } else { console.error("Erwartetes Array, aber erhalten:", data); } - dispatch(setChartData(data)); - setShowChart(true); } catch (error) { console.error("Fehler beim Laden der Daten:", error); - if (error instanceof Response) { - const errorMessage = await error.text(); - console.error("Fehlermeldung vom Server:", errorMessage); - } } }; @@ -39,7 +33,7 @@ const LoopChartActionBar: React.FC = () => { > Aktualisieren - {showChart && } + {showChart && null} ); }; diff --git a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx index 40cb3e8..9826be5 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx @@ -33,7 +33,7 @@ const TDRChartActionBar: React.FC = () => { > Aktualisieren - {showChart && } + {showChart && null} ); };