From f50bff4819866afcc3e649ad61e41717b257dafa Mon Sep 17 00:00:00 2001 From: ISA Date: Wed, 2 Jul 2025 14:16:08 +0200 Subject: [PATCH] fix: ConfirmModal-Zustand in Redux ausgelagert zur Stabilisierung MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Neuen confirmModalSlice erstellt für globale Steuerung des Bestätigungsdialogs - Zustand wird nun nicht mehr durch Re-Renders oder Komponentenneuaufbau zurückgesetzt - ConfirmModal in KueEinstellung.tsx vollständig an Redux angebunden - Flackern und automatisches Schließen nach 10–15 Sekunden dauerhaft behoben --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 11 +++++++ .../kue705FO/modals/KueEinstellung.tsx | 14 ++++++--- package-lock.json | 4 +-- package.json | 2 +- redux/slices/confirmModalSlice.ts | 29 +++++++++++++++++++ redux/store.ts | 2 ++ 8 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 redux/slices/confirmModalSlice.ts diff --git a/.env.development b/.env.development index 419aa53..6e5655d 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_USE_CGI=false # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.521 +NEXT_PUBLIC_APP_VERSION=1.6.522 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index 30474a1..3d819fb 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_USE_CGI=true # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.521 +NEXT_PUBLIC_APP_VERSION=1.6.522 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8593648..dafc418 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [1.6.522] – 2025-07-02 + +- feat: Auth-Status bei App-Start aus localStorage laden und in Redux speichern + +- fetchAuthService erstellt zum Auslesen von isAdminLoggedIn aus localStorage +- getAuthThunks Thunk implementiert zur Initialisierung von authSlice +- authSlice erweitert um setIsAdminLoggedIn Reducer +- dispatch(getAuthThunks()) in _app.tsx integriert für automatische Initialisierung bei App-Start +- Flackern und falscher Admin-Status nach Reload dauerhaft behoben + +--- ## [1.6.521] – 2025-07-02 - refactor: Admin-Status direkt aus Redux ausgelesen und Props entfernt diff --git a/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx b/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx index 43041c9..17ab199 100644 --- a/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx +++ b/components/main/kabelueberwachung/kue705FO/modals/KueEinstellung.tsx @@ -9,6 +9,10 @@ import firmwareUpdate from "../handlers/firmwareUpdate"; import ProgressModal from "@/components/main/settingsPageComponents/modals/ProgressModal"; import { toast } from "react-toastify"; import ConfirmModal from "@/components/common/ConfirmModal"; +import { + openConfirmModal, + closeConfirmModal, +} from "@/redux/slices/confirmModalSlice"; interface Props { slot: number; @@ -49,7 +53,9 @@ export default function KueEinstellung({ ); const [isAdminLoggedIn] = useState(() => reduxAdmin); - const [showConfirmModal, setShowConfirmModal] = useState(false); + const showConfirmModal = useSelector( + (state: RootState) => state.confirmModal.open + ); const [isUpdating, setIsUpdating] = useState(false); const [progress, setProgress] = useState(0); @@ -243,7 +249,7 @@ export default function KueEinstellung({ {isAdminLoggedIn && ( <>