fix: hide Firmware update button if admin not loged in
This commit is contained in:
@@ -12,15 +12,15 @@ import { AppDispatch } from "../../../redux/store";
|
||||
import { getSystemSettingsThunk } from "../../../redux/thunks/getSystemSettingsThunk";
|
||||
import handleGeneralSubmit from "./handlers/handleGeneralSubmit";
|
||||
import handleKueFirmwareUpdate from "@/components/main/settingsPageComponents/handlers/handleKueFirmwareUpdate";
|
||||
import { useAdminAuth } from "@/components/main/settingsPageComponents/hooks/useAdminAuth";
|
||||
|
||||
const GeneralSettings: React.FC = () => {
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
const systemSettings = useSelector(
|
||||
(state: RootState) => state.systemSettingsSlice
|
||||
);
|
||||
const isAdmin = useSelector(
|
||||
(state: RootState) => state.authSlice?.isAdminLoggedIn
|
||||
);
|
||||
|
||||
const { isAdminLoggedIn } = useAdminAuth(true);
|
||||
|
||||
// const [error, setError] = useState("");
|
||||
|
||||
@@ -196,10 +196,10 @@ const GeneralSettings: React.FC = () => {
|
||||
>
|
||||
Neustart CPL
|
||||
</button>
|
||||
{isAdmin && (
|
||||
{isAdminLoggedIn && (
|
||||
<button
|
||||
type="button"
|
||||
className="bg-red-600 text-white px-4 py-2 h-8 text-xs rounded whitespace-nowrap"
|
||||
className="bg-littwin-blue text-white px-4 py-2 h-8 text-xs rounded whitespace-nowrap"
|
||||
onClick={handleKueFirmwareUpdate}
|
||||
>
|
||||
Firmwareupdate alle KÜ-Module
|
||||
|
||||
Reference in New Issue
Block a user