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:
ISA
2025-07-02 12:35:15 +02:00
parent e46e23fada
commit a7d1e1e8df
7 changed files with 41 additions and 8 deletions

View File

@@ -13,7 +13,6 @@ import ConfirmModal from "@/components/common/ConfirmModal";
interface Props {
slot: number;
showModal: boolean;
isAdminLoggedIn: boolean; // NEU
onClose?: () => void;
onModulNameChange?: (id: string) => void;
}
@@ -32,7 +31,6 @@ const memoryIntervalOptions = [
export default function KueEinstellung({
slot,
isAdminLoggedIn,
onClose = () => {},
onModulNameChange,
}: Props) {
@@ -46,6 +44,11 @@ export default function KueEinstellung({
kueLoopInterval,
memoryInterval,
} = useSelector((state: RootState) => state.kueDataSlice);
const reduxAdmin = useSelector(
(state: RootState) => state.authSlice.isAdminLoggedIn
);
const [isAdminLoggedIn] = useState(() => reduxAdmin);
const [showConfirmModal, setShowConfirmModal] = useState(false);
const [isUpdating, setIsUpdating] = useState(false);