mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 20:56:50 +02:00
fix(setup): redirects to /setup on browser
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user