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 response = await fetch("/mockData.json");
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
// data ist ein Array und kann mit .map() verwendet werden
|
|
||||||
console.log("Daten geladen:", data);
|
console.log("Daten geladen:", data);
|
||||||
|
dispatch(setChartData(data));
|
||||||
} else {
|
} else {
|
||||||
console.error("Erwartetes Array, aber erhalten:", data);
|
console.error("Erwartetes Array, aber erhalten:", data);
|
||||||
}
|
}
|
||||||
dispatch(setChartData(data));
|
|
||||||
setShowChart(true);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Fehler beim Laden der Daten:", 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
|
Aktualisieren
|
||||||
</button>
|
</button>
|
||||||
{showChart && <LoopMeasurementChart />}
|
{showChart && null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const TDRChartActionBar: React.FC = () => {
|
|||||||
>
|
>
|
||||||
Aktualisieren
|
Aktualisieren
|
||||||
</button>
|
</button>
|
||||||
{showChart && <TDRChart />}
|
{showChart && null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user