mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
fix getting sync setup
This commit is contained in:
@@ -4,6 +4,7 @@ const log = require('./log');
|
||||
const sqlInit = require('./sql_init');
|
||||
const repository = require('./repository');
|
||||
const optionService = require('./options');
|
||||
const syncOptions = require('./sync_options');
|
||||
|
||||
async function isSyncServerInitialized() {
|
||||
const response = await requestToSyncServer('GET', '/api/setup/status');
|
||||
@@ -36,11 +37,8 @@ async function setupSyncToSyncServer() {
|
||||
}
|
||||
|
||||
async function requestToSyncServer(method, path, body = null) {
|
||||
const syncServerHost = await optionService.getOption('syncServerHost');
|
||||
const syncProxy = await optionService.getOption('syncProxy');
|
||||
|
||||
const rpOpts = {
|
||||
uri: syncServerHost + path,
|
||||
uri: await syncOptions.getSyncServerHost() + path,
|
||||
method: method,
|
||||
json: true
|
||||
};
|
||||
@@ -49,6 +47,8 @@ async function requestToSyncServer(method, path, body = null) {
|
||||
rpOpts.body = body;
|
||||
}
|
||||
|
||||
const syncProxy = await syncOptions.getSyncProxy();
|
||||
|
||||
if (syncProxy) {
|
||||
rpOpts.proxy = syncProxy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user