fix: Firmware-Update-Button stabilisiert und Flackern entfernt
- useAdminAuth aus KueEinstellung entfernt und einmalig in SettingsModalWrapper ausgelagert - isAdminLoggedIn als Prop übergeben, um ständige Aktualisierungen zu vermeiden - Button wird jetzt stabil angezeigt ohne console-Logs oder Intervall-Aufrufe
This commit is contained in:
@@ -4,6 +4,7 @@ import ReactModal from "react-modal";
|
||||
import KueEinstellung from "./KueEinstellung";
|
||||
import TdrEinstellung from "./TdrEinstellung";
|
||||
import Knotenpunkte from "./Knotenpunkte";
|
||||
import { useAdminAuth } from "@/components/main/settingsPageComponents/hooks/useAdminAuth";
|
||||
|
||||
interface KueModalProps {
|
||||
showModal: boolean;
|
||||
@@ -20,6 +21,8 @@ declare global {
|
||||
}
|
||||
|
||||
export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
const { isAdminLoggedIn } = useAdminAuth(true);
|
||||
|
||||
const [activeTab, setActiveTab] = useState<"kue" | "tdr" | "knoten">(() => {
|
||||
if (typeof window !== "undefined" && window.__lastKueTab) {
|
||||
return window.__lastKueTab;
|
||||
@@ -100,6 +103,7 @@ export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
showModal={showModal}
|
||||
onModulNameChange={(id) => console.log("Modulname geändert:", id)}
|
||||
onClose={onClose}
|
||||
isAdminLoggedIn={isAdminLoggedIn} // Neue
|
||||
/>
|
||||
)}
|
||||
{activeTab === "tdr" && (
|
||||
|
||||
Reference in New Issue
Block a user