fix: build fix webversion 1.6.337 TDR-Einstellung Modal und Digitale Ausgänge

This commit is contained in:
ISA
2025-05-02 08:21:15 +02:00
parent 1363445388
commit 7834bbca39
3 changed files with 10 additions and 17 deletions

View File

@@ -1,4 +1,9 @@
"use client"; "use client";
declare global {
interface Window {
__tdrCache?: Record<string, { data: any; tdrActive: boolean }>;
}
}
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
@@ -17,7 +22,9 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
window.__tdrCache = window.__tdrCache || {}; window.__tdrCache = window.__tdrCache || {};
} }
const cachedTdr = const cachedTdr =
typeof window !== "undefined" ? window.__tdrCache[cacheKey] : null; typeof window !== "undefined"
? window.__tdrCache?.[cacheKey] ?? null
: null;
const [tdrData, setTdrData] = useState( const [tdrData, setTdrData] = useState(
() => () =>
@@ -36,7 +43,7 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
const updateCache = (data: typeof tdrData, active = tdrActive) => { const updateCache = (data: typeof tdrData, active = tdrActive) => {
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
window.__tdrCache[cacheKey] = { (window.__tdrCache ??= {})[cacheKey] = {
data, data,
tdrActive: active, tdrActive: active,
}; };

View File

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

View File

@@ -5,12 +5,10 @@ import { useDispatch, useSelector } from "react-redux";
import { AppDispatch, RootState } from "../redux/store"; import { AppDispatch, RootState } from "../redux/store";
import InputModal from "../components/main/einausgaenge/modals/InputModal"; import InputModal from "../components/main/einausgaenge/modals/InputModal";
import OutputModal from "../components/main/einausgaenge/modals/OutputModal";
import { fetchDigitaleEingaengeThunk } from "../redux/thunks/fetchDigitaleEingaengeThunk"; import { fetchDigitaleEingaengeThunk } from "../redux/thunks/fetchDigitaleEingaengeThunk";
import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk"; import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk";
import DigitalOutputs from "../components/main/einausgaenge/DigitalOutputs";
import DigitalInputs from "../components/main/einausgaenge/DigitalInputs"; import DigitalInputs from "../components/main/einausgaenge/DigitalInputs";
const EinAusgaenge: React.FC = () => { const EinAusgaenge: React.FC = () => {
@@ -72,10 +70,6 @@ const EinAusgaenge: React.FC = () => {
openInputModal={openInputModal} openInputModal={openInputModal}
inputRange={{ start: 16, end: 32 }} inputRange={{ start: 16, end: 32 }}
/> />
{/* Digitale Ausgänge nicht Erforderlich*/}
{/*
<DigitalOutputs openOutputModal={openOutputModal} />
*/}
</div> </div>
{isInputModalOpen && selectedInput && ( {isInputModalOpen && selectedInput && (
@@ -85,14 +79,6 @@ const EinAusgaenge: React.FC = () => {
isOpen={isInputModalOpen} isOpen={isInputModalOpen}
/> />
)} )}
{isOutputModalOpen && selectedOutput && (
<OutputModal
selectedOutput={selectedOutput}
closeOutputModal={closeOutputModal}
isOpen={isOutputModalOpen}
/>
)}
</div> </div>
); );
}; };