fix:kein doppelte Chart Effekt in einem Modal
This commit is contained in:
@@ -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
|
||||
</button>
|
||||
{showChart && <LoopMeasurementChart />}
|
||||
{showChart && null}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user