fix: Eingabedaten im KUE-Modal persistent über window.__kueCache gespeichert

- Lokale Zustände unabhängig von Redux-Intervallen gemacht
- window.__kueCache speichert pro Slot die aktuellen Eingabedaten
- Rückschreiben in Redux erfolgt nur beim Speichern
- Remounts und Polling beeinflussen keine laufenden Eingaben mehr
This commit is contained in:
Ismail Ali
2025-04-29 23:50:46 +02:00
parent 29bccd5ff2
commit 3a3340da7a
3 changed files with 78 additions and 157 deletions

View File

@@ -27,6 +27,11 @@ export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
(window as any).__lastKueTab = activeTab;
}
}, [activeTab]);
useEffect(() => {
if (typeof window !== "undefined") {
window.kabelModalOpen = showModal;
}
}, [showModal]);
return (
<ReactModal
@@ -94,15 +99,15 @@ export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
</div>
<div className="p-4 bg-white rounded-b-md max-h-[75vh] overflow-y-auto">
{activeTab === "kue" && (
<div style={{ display: activeTab === "kue" ? "block" : "none" }}>
<KueEinstellung
slot={slot}
onModulNameChange={(id) => {
console.log("Modulname geändert:", id);
}}
showModal={showModal} // ← hier übergeben
onModulNameChange={(id) => console.log("Modulname geändert:", id)}
onClose={onClose}
/>
)}
</div>
{activeTab === "tdr" && <TdrEinstellung slot={slot} />}
{activeTab === "knoten" && <Knotenpunkte slot={slot} />}
</div>