fix: KÜs werden angezeigt, _app.tsx error
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Provider } from "react-redux";
|
||||
import store, { useAppDispatch } from "../redux/store";
|
||||
import { loadWindowVariables } from "../utils/loadWindowVariables";
|
||||
import Header from "../components/header/Header";
|
||||
import Navigation from "../components/navigation/Navigation";
|
||||
import Footer from "../components/footer/Footer";
|
||||
import WindowVariablesInitializer from "../components/WindowVariablesInitializer";
|
||||
import "../styles/globals.css";
|
||||
import { AppProps } from "next/app";
|
||||
import { setVariables } from "../redux/slices/variablesSlice";
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
@@ -26,6 +28,15 @@ function AppContent({ Component, pageProps }: AppProps) {
|
||||
useEffect(() => {
|
||||
const loadAndStoreVariables = async () => {
|
||||
try {
|
||||
const variables = await loadWindowVariables();
|
||||
if (!variables) throw new Error("Sitzungsfehler");
|
||||
|
||||
//console.log("✅ Window-Variablen geladen:", variables);
|
||||
|
||||
const { ...restVariables } = variables;
|
||||
|
||||
dispatch(setVariables(restVariables));
|
||||
|
||||
setSessionExpired(false);
|
||||
} catch (error) {
|
||||
console.error("❌ Fehler beim Laden der Sitzung:", error);
|
||||
|
||||
Reference in New Issue
Block a user