fix: build fix webversion 1.6.337 TDR-Einstellung Modal und Digitale Ausgänge
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
"use client";
|
||||
declare global {
|
||||
interface Window {
|
||||
__tdrCache?: Record<string, { data: any; tdrActive: boolean }>;
|
||||
}
|
||||
}
|
||||
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
@@ -17,7 +22,9 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
|
||||
window.__tdrCache = window.__tdrCache || {};
|
||||
}
|
||||
const cachedTdr =
|
||||
typeof window !== "undefined" ? window.__tdrCache[cacheKey] : null;
|
||||
typeof window !== "undefined"
|
||||
? window.__tdrCache?.[cacheKey] ?? null
|
||||
: null;
|
||||
|
||||
const [tdrData, setTdrData] = useState(
|
||||
() =>
|
||||
@@ -36,7 +43,7 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
|
||||
|
||||
const updateCache = (data: typeof tdrData, active = tdrActive) => {
|
||||
if (typeof window !== "undefined") {
|
||||
window.__tdrCache[cacheKey] = {
|
||||
(window.__tdrCache ??= {})[cacheKey] = {
|
||||
data,
|
||||
tdrActive: active,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user