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