diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index ad473421d..05d190c91 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -366,7 +366,7 @@ class NoteTextComponent extends React.Component { webviewReady: true, }); - if (Setting.value('env') === 'dev') this.webview_.openDevTools(); + // if (Setting.value('env') === 'dev') this.webview_.openDevTools(); } webview_ref(element) { diff --git a/ElectronClient/app/main-html.js b/ElectronClient/app/main-html.js index d127c883d..7a71c3613 100644 --- a/ElectronClient/app/main-html.js +++ b/ElectronClient/app/main-html.js @@ -73,7 +73,7 @@ app().start(bridge().processArgv()).then(() => { if (error.fileName) msg.push(error.fileName); if (error.lineNumber) msg.push(error.lineNumber); if (error.stack) msg.push(error.stack); - bridge().showErrorMessageBox(msg.join('\n')); + bridge().showErrorMessageBox(msg.join('\n\n')); } bridge().electronApp().exit(1); diff --git a/ReactNativeClient/lib/ObjectUtils.js b/ReactNativeClient/lib/ObjectUtils.js index 366156e5f..3bb023499 100644 --- a/ReactNativeClient/lib/ObjectUtils.js +++ b/ReactNativeClient/lib/ObjectUtils.js @@ -44,4 +44,13 @@ ObjectUtils.fieldsEqual = function(o1, o2) { return true; } +ObjectUtils.convertValuesToFunctions = function(o) { + const output = {}; + for (let n in o) { + if (!o.hasOwnProperty(n)) continue; + output[n] = () => { return typeof o[n] === 'function' ? o[n]() : o[n]; } + } + return output; +} + module.exports = ObjectUtils; \ No newline at end of file diff --git a/ReactNativeClient/lib/SyncTargetNextcloud.js b/ReactNativeClient/lib/SyncTargetNextcloud.js index b050146a7..57ba9900c 100644 --- a/ReactNativeClient/lib/SyncTargetNextcloud.js +++ b/ReactNativeClient/lib/SyncTargetNextcloud.js @@ -38,9 +38,9 @@ class SyncTargetNextcloud extends BaseSyncTarget { async initFileApi() { const fileApi = await SyncTargetWebDAV.newFileApi_(SyncTargetNextcloud.id(), { - path: Setting.value('sync.5.path'), - username: Setting.value('sync.5.username'), - password: Setting.value('sync.5.password'), + path: () => Setting.value('sync.5.path'), + username: () => Setting.value('sync.5.username'), + password: () => Setting.value('sync.5.password'), }); fileApi.setLogger(this.logger()); diff --git a/ReactNativeClient/lib/SyncTargetWebDAV.js b/ReactNativeClient/lib/SyncTargetWebDAV.js index 7c67fb5eb..6c17e9617 100644 --- a/ReactNativeClient/lib/SyncTargetWebDAV.js +++ b/ReactNativeClient/lib/SyncTargetWebDAV.js @@ -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()); diff --git a/ReactNativeClient/lib/components/shared/config-shared.js b/ReactNativeClient/lib/components/shared/config-shared.js index 60a1ddd7a..4a907a261 100644 --- a/ReactNativeClient/lib/components/shared/config-shared.js +++ b/ReactNativeClient/lib/components/shared/config-shared.js @@ -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 }); }