From e2dfe1b6de46b2a485447e155468b0f7f4e6dccb Mon Sep 17 00:00:00 2001 From: azivner Date: Thu, 3 Jan 2019 22:32:36 +0100 Subject: [PATCH] fixed setup page issues which caused wrong choice to be used in the wizard --- src/public/javascripts/setup.js | 16 +++++----------- src/views/setup.ejs | 6 +++--- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/public/javascripts/setup.js b/src/public/javascripts/setup.js index 09d102b72..3239d8a13 100644 --- a/src/public/javascripts/setup.js +++ b/src/public/javascripts/setup.js @@ -25,26 +25,20 @@ function SetupModel() { this.instanceType = utils.isElectron() ? "desktop" : "server"; - this.setupTypeSelected = this.getSetupType = () => - this.setupNewDocument() - || this.setupSyncFromDesktop() - || this.setupSyncFromServer(); + this.setupTypeSelected = () => !!this.setupType(); this.selectSetupType = () => { - this.step(this.getSetupType()); - this.setupType(this.getSetupType()); + this.step(this.setupType()); }; this.back = () => { this.step("setup-type"); - this.setupNewDocument(false); - this.setupSyncFromServer(false); - this.setupSyncFromDesktop(false); + this.setupType(""); }; this.finish = async () => { - if (this.setupNewDocument()) { + if (this.setupType() === 'new-document') { const username = this.username(); const password1 = this.password1(); const password2 = this.password2(); @@ -72,7 +66,7 @@ function SetupModel() { window.location.replace("/"); }); } - else if (this.setupSyncFromServer()) { + else if (this.setupType() === 'sync-from-server') { const syncServerHost = this.syncServerHost(); const syncProxy = this.syncProxy(); const username = this.username(); diff --git a/src/views/setup.ejs b/src/views/setup.ejs index af35f0417..b64c869fb 100644 --- a/src/views/setup.ejs +++ b/src/views/setup.ejs @@ -13,15 +13,15 @@
-
-
-