mirror of
https://github.com/zadam/trilium.git
synced 2025-01-01 04:41:46 +08:00
fix getting sync setup
This commit is contained in:
parent
947e875b6c
commit
e8797a137f
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue