fix(setup): redirects to /setup on browser

This commit is contained in:
Elian Doran
2026-03-26 11:45:52 +02:00
parent 2016c97a12
commit a5da35b7ae

View File

@@ -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();