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:52 +02:00
parent a7d1e1e8df
commit 1ec2c5cc14
6 changed files with 15 additions and 10 deletions

View File

@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.519 NEXT_PUBLIC_APP_VERSION=1.6.520
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.519 NEXT_PUBLIC_APP_VERSION=1.6.520
NEXT_PUBLIC_CPL_MODE=production NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,13 @@
## [1.6.520] 2025-07-02
- 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
---
## [1.6.519] 2025-07-02 ## [1.6.519] 2025-07-02
- fix: Firmware-Update-Button stabilisiert und Flackern entfernt - fix: Firmware-Update-Button stabilisiert und Flackern entfernt

View File

@@ -4,7 +4,6 @@ import ReactModal from "react-modal";
import KueEinstellung from "./KueEinstellung"; import KueEinstellung from "./KueEinstellung";
import TdrEinstellung from "./TdrEinstellung"; import TdrEinstellung from "./TdrEinstellung";
import Knotenpunkte from "./Knotenpunkte"; import Knotenpunkte from "./Knotenpunkte";
import { useAdminAuth } from "@/components/main/settingsPageComponents/hooks/useAdminAuth";
interface KueModalProps { interface KueModalProps {
showModal: boolean; showModal: boolean;
@@ -21,9 +20,6 @@ declare global {
} }
export default function KueModal({ showModal, onClose, slot }: KueModalProps) { 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">(() => { const [activeTab, setActiveTab] = useState<"kue" | "tdr" | "knoten">(() => {
if (typeof window !== "undefined" && window.__lastKueTab) { if (typeof window !== "undefined" && window.__lastKueTab) {
return window.__lastKueTab; return window.__lastKueTab;
@@ -106,7 +102,6 @@ export default function KueModal({ showModal, onClose, slot }: KueModalProps) {
showModal={showModal} showModal={showModal}
onModulNameChange={(id) => console.log("Modulname geändert:", id)} onModulNameChange={(id) => console.log("Modulname geändert:", id)}
onClose={onClose} onClose={onClose}
isAdminLoggedIn={isAdminLoggedIn} // Neue
/> />
)} )}
{activeTab === "tdr" && ( {activeTab === "tdr" && (

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.519", "version": "1.6.520",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.519", "version": "1.6.520",
"dependencies": { "dependencies": {
"@fontsource/roboto": "^5.1.0", "@fontsource/roboto": "^5.1.0",
"@iconify-icons/ri": "^1.2.10", "@iconify-icons/ri": "^1.2.10",

View File

@@ -1,6 +1,6 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.519", "version": "1.6.520",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",