diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index b25b38e..1c89dba 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -30,10 +30,16 @@ function App() { const setTheme = (theme: string) => { _setTheme(theme); localStorage.setItem("theme", theme); + bc.postMessage(theme); }; const [toasts, setToasts] = useState([]); const [isLoading, setIsLoading] = useState(false); + const bc = new BroadcastChannel("theme-channel"); + bc.onmessage = (ev) => { + _setTheme(ev.data as string); + }; + useEffect(() => { if (theme !== "default" && theme !== "sakura") { document.body.classList.remove("sakura-theme");