mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
sync login now includes check for sync server initialization and initializes it if necessary
Test sync button strictly not necessary
This commit is contained in:
@@ -33,8 +33,6 @@ async function setupSyncToSyncServer() {
|
||||
// the previous request would have failed.
|
||||
await optionService.setOption('lastSyncedPush', 0);
|
||||
await optionService.setOption('lastSyncedPull', 0);
|
||||
|
||||
syncService.sync();
|
||||
}
|
||||
|
||||
async function requestToSyncServer(method, path, body = null) {
|
||||
|
||||
@@ -69,6 +69,16 @@ async function sync() {
|
||||
}
|
||||
|
||||
async function login() {
|
||||
const setupService = require('./setup'); // circular dependency issue
|
||||
|
||||
if (!await setupService.isSyncServerInitialized()) {
|
||||
await setupService.setupSyncToSyncServer();
|
||||
}
|
||||
|
||||
return await doLogin();
|
||||
}
|
||||
|
||||
async function doLogin() {
|
||||
const timestamp = dateUtils.nowDate();
|
||||
|
||||
const documentSecret = await optionService.getOption('documentSecret');
|
||||
|
||||
Reference in New Issue
Block a user