diff --git a/src/public/javascripts/dialogs/options.js b/src/public/javascripts/dialogs/options.js index c7e0d3297..4a6b0b162 100644 --- a/src/public/javascripts/dialogs/options.js +++ b/src/public/javascripts/dialogs/options.js @@ -247,7 +247,7 @@ addTabHandler((function() { infoService.showMessage(result.message); } else { - infoService.showError("Sync server handshake failed, error: " + result.error); + infoService.showError("Sync server handshake failed, error: " + result.message); } }); diff --git a/src/routes/api/sync.js b/src/routes/api/sync.js index 044b853de..f77786548 100644 --- a/src/routes/api/sync.js +++ b/src/routes/api/sync.js @@ -8,9 +8,14 @@ const sqlInit = require('../../services/sql_init'); const optionService = require('../../services/options'); const contentHashService = require('../../services/content_hash'); const log = require('../../services/log'); +const syncOptions = require('../../services/sync_options'); async function testSync() { try { + if (!await syncOptions.isSyncSetup()) { + return { success: false, message: "Sync server host is not configured. Please configure sync first." }; + } + await syncService.login(); // login was successful so we'll kick off sync now @@ -22,7 +27,7 @@ async function testSync() { catch (e) { return { success: false, - error: e.message + message: e.message }; } }