refactor: Admin-Status direkt aus Redux ausgelesen und Props entfernt
- isAdminLoggedIn wird jetzt direkt aus authSlice im Redux-Store gelesen - useAdminAuth und Prop-Weitergabe entfernt - Flackern des Firmware-Buttons dauerhaft behoben - Codestruktur vereinfacht und stabilisiert
This commit is contained in:
@@ -4,7 +4,6 @@ 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;
|
||||
@@ -21,9 +20,6 @@ declare global {
|
||||
}
|
||||
|
||||
export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
|
||||
const { isAdminLoggedIn: reduxIsAdminLoggedIn } = useAdminAuth(true);
|
||||
const [isAdminLoggedIn] = useState(() => reduxIsAdminLoggedIn); // stabil, flackerfrei
|
||||
|
||||
const [activeTab, setActiveTab] = useState<"kue" | "tdr" | "knoten">(() => {
|
||||
if (typeof window !== "undefined" && window.__lastKueTab) {
|
||||
return window.__lastKueTab;
|
||||
@@ -106,7 +102,6 @@ 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