From a5da35b7aedf3f9e22d2d6cdcdbbab8782154e00 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 26 Mar 2026 11:45:52 +0200 Subject: [PATCH] fix(setup): redirects to /setup on browser --- apps/client/src/setup.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx index 7c9dad57ec..ba71d0511f 100644 --- a/apps/client/src/setup.tsx +++ b/apps/client/src/setup.tsx @@ -167,7 +167,7 @@ function SyncInProgress({ device }: { device: "server" | "desktop" }) { useEffect(() => { if (stats.initialized) { - location.href = "setup"; + onSetupFinished(); } }, [stats.initialized]); @@ -250,9 +250,7 @@ function CreateNewDocumentOptions({ setState }: { setState: (state: State) => vo function CreateNewDocumentInProgress({ withDemo = false }: { withDemo?: boolean }) { useEffect(() => { - server.post(`setup/new-document${withDemo ? "" : "?skipDemoDb"}`).then(() => { - location.href = "setup"; - }); + server.post(`setup/new-document${withDemo ? "" : "?skipDemoDb"}`).then(onSetupFinished); }, [ withDemo ]); return ( @@ -502,4 +500,13 @@ function networkScore(addr: string): number { return 3; } +function onSetupFinished() { + if (isElectron()) { + // On Electron we need to use the setup route because it handles the closing of the setup window and opening the main app window. + location.href = "setup"; + } else { + location.reload(); + } +} + main();