Header,Footer und dashboard bekommen Daten von IndexedDB statt von Window Objekt

This commit is contained in:
ISA
2024-10-31 14:01:09 +01:00
parent 2fd61c7f7c
commit f2143daa51
5 changed files with 90 additions and 137 deletions

View File

@@ -9,10 +9,19 @@ import "../styles/globals.css";
function MyApp({ Component, pageProps }) {
useEffect(() => {
if (typeof window !== "undefined") {
const initializeDatabase = async () => {
try {
await loadWindowVariables();
console.log("IndexedDB initialisiert.");
} catch (error) {
console.error("Fehler bei der Initialisierung der IndexedDB:", error);
}
};
initializeDatabase();
setInterval(() => {
loadWindowVariables();
}, 10000);
loadWindowVariables();
}
}, []);