1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +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

@@ -30,9 +30,9 @@ class SyncTargetWebDAV extends BaseSyncTarget {
static async newFileApi_(syncTargetId, options) {
const apiOptions = {
baseUrl: () => options.path,
username: () => options.username,
password: () => options.password,
baseUrl: () => options.path(),
username: () => options.username(),
password: () => options.password(),
};
const api = new WebDavApi(apiOptions);
@@ -65,9 +65,9 @@ class SyncTargetWebDAV extends BaseSyncTarget {
async initFileApi() {
const fileApi = await SyncTargetWebDAV.newFileApi_(SyncTargetWebDAV.id(), {
path: Setting.value('sync.6.path'),
username: Setting.value('sync.6.username'),
password: Setting.value('sync.6.password'),
path: () => Setting.value('sync.6.path'),
username: () => Setting.value('sync.6.username'),
password: () => Setting.value('sync.6.password'),
});
fileApi.setLogger(this.logger());