fix: Typfehler in useLoopDisplay und Kue705FO behoben, Build erfolgreich
- useLoopDisplay.ts angepasst: useState nun explizit als `number` deklariert - Typensicherheit in Kue705FO.tsx verbessert: - `schleifenwiderstand` wird immer als `number` konvertiert - `setLoopDisplayValue` akzeptiert nur `number` - Fehlerhafte Typzuweisung in `handleButtonClick` korrigiert - `npm run build` läuft nun ohne Fehler ✅ Code nun sauber typisiert, keine TypeScript-Fehler mehr 🚀
This commit is contained in:
@@ -15,6 +15,7 @@ import { setActiveMode } from "../../../../redux/slices/kueChartModeSlice";
|
||||
import handleButtonClick from "./kue705FO-Funktionen/handleButtonClick";
|
||||
import { setChartOpen } from "../../../../redux/slices/kabelueberwachungChartSlice";
|
||||
import { setSlotNumber } from "../../../../redux/slices/kabelueberwachungChartSlice";
|
||||
import { createTDRChart } from "../../../../utils/chartUtils";
|
||||
//-------hooks----------------
|
||||
import useChartPlugin from "./hooks/useChartPlugin";
|
||||
import useAlarmStatus from "./hooks/useAlarmStatus";
|
||||
@@ -174,7 +175,13 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
||||
modulName
|
||||
);
|
||||
|
||||
const loopDisplayValue = useLoopDisplay(schleifenwiderstand, activeButton);
|
||||
const { loopDisplayValue, setLoopDisplayValue } = useLoopDisplay(
|
||||
typeof schleifenwiderstand === "number"
|
||||
? schleifenwiderstand
|
||||
: Number(schleifenwiderstand),
|
||||
activeButton
|
||||
);
|
||||
|
||||
const zoomPlugin = useChartPlugin();
|
||||
useChartData(loopMeasurementCurveChartData);
|
||||
|
||||
@@ -304,7 +311,10 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
||||
"Schleife",
|
||||
setActiveButton,
|
||||
setloopTitleText,
|
||||
setLoopDisplayValue,
|
||||
(value) =>
|
||||
setLoopDisplayValue(
|
||||
typeof value === "number" ? value : Number(value)
|
||||
), // Hier sicherstellen, dass nur number übergeben wird
|
||||
Number(schleifenwiderstand), // <- Stelle sicher, dass es eine Zahl ist
|
||||
tdrLocation,
|
||||
slotIndex,
|
||||
@@ -325,7 +335,10 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
|
||||
"TDR",
|
||||
setActiveButton,
|
||||
setloopTitleText,
|
||||
setLoopDisplayValue,
|
||||
(value) =>
|
||||
setLoopDisplayValue(
|
||||
typeof value === "number" ? value : Number(value)
|
||||
), // Hier sicherstellen, dass nur number übergeben wird
|
||||
Number(schleifenwiderstand), // <- Stelle sicher, dass es eine Zahl ist
|
||||
tdrLocation,
|
||||
slotIndex,
|
||||
|
||||
Reference in New Issue
Block a user