mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
report missing sync configuration when clicking on Test sync
This commit is contained in:
parent
9b425025c9
commit
3af27845b5
@ -247,7 +247,7 @@ addTabHandler((function() {
|
|||||||
infoService.showMessage(result.message);
|
infoService.showMessage(result.message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
infoService.showError("Sync server handshake failed, error: " + result.error);
|
infoService.showError("Sync server handshake failed, error: " + result.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -8,9 +8,14 @@ const sqlInit = require('../../services/sql_init');
|
|||||||
const optionService = require('../../services/options');
|
const optionService = require('../../services/options');
|
||||||
const contentHashService = require('../../services/content_hash');
|
const contentHashService = require('../../services/content_hash');
|
||||||
const log = require('../../services/log');
|
const log = require('../../services/log');
|
||||||
|
const syncOptions = require('../../services/sync_options');
|
||||||
|
|
||||||
async function testSync() {
|
async function testSync() {
|
||||||
try {
|
try {
|
||||||
|
if (!await syncOptions.isSyncSetup()) {
|
||||||
|
return { success: false, message: "Sync server host is not configured. Please configure sync first." };
|
||||||
|
}
|
||||||
|
|
||||||
await syncService.login();
|
await syncService.login();
|
||||||
|
|
||||||
// login was successful so we'll kick off sync now
|
// login was successful so we'll kick off sync now
|
||||||
@ -22,7 +27,7 @@ async function testSync() {
|
|||||||
catch (e) {
|
catch (e) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
error: e.message
|
message: e.message
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user