1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Made WebDAV options dynamics so that changing username or password doesn't require restarting the app

This commit is contained in:
Laurent Cozic
2018-03-15 17:57:11 +00:00
parent 9e0bf1acb2
commit 1532b6d159
6 changed files with 22 additions and 12 deletions

View File

@ -1,5 +1,6 @@
const Setting = require('lib/models/Setting.js');
const SyncTargetRegistry = require('lib/SyncTargetRegistry');
const ObjectUtils = require('lib/ObjectUtils');
const { _ } = require('lib/locale.js');
const shared = {}
@ -16,7 +17,7 @@ shared.checkSyncConfig = async function(comp, settings) {
const SyncTargetClass = SyncTargetRegistry.classById(syncTargetId);
const options = Setting.subValues('sync.' + syncTargetId, settings);
comp.setState({ checkSyncConfigResult: 'checking' });
const result = await SyncTargetClass.checkConfig(options);
const result = await SyncTargetClass.checkConfig(ObjectUtils.convertValuesToFunctions(options));
comp.setState({ checkSyncConfigResult: result });
}