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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user