1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop: Improved Nextcloud API error handling

This commit is contained in:
Laurent Cozic
2019-12-18 15:32:19 +00:00
parent ce7671151c
commit 888a9ddaf4
3 changed files with 33 additions and 21 deletions

View File

@@ -59,7 +59,7 @@ shared.checkNextcloudApp = async function(comp, settings) {
comp.setState({ checkNextcloudAppResult: 'checking' });
let result = null;
const appApi = await reg.syncTargetNextcloud().appApi();
const appApi = await reg.syncTargetNextcloud().appApi(settings);
try {
result = await appApi.setupSyncTarget(settings['sync.5.path']);
@@ -79,14 +79,16 @@ shared.checkNextcloudApp = async function(comp, settings) {
};
shared.updateSettingValue = function(comp, key, value) {
const settings = Object.assign({}, comp.state.settings);
const changedSettingKeys = comp.state.changedSettingKeys.slice();
settings[key] = Setting.formatValue(key, value);
if (changedSettingKeys.indexOf(key) < 0) changedSettingKeys.push(key);
comp.setState(state => {
const settings = Object.assign({}, state.settings);
const changedSettingKeys = state.changedSettingKeys.slice();
settings[key] = Setting.formatValue(key, value);
if (changedSettingKeys.indexOf(key) < 0) changedSettingKeys.push(key);
comp.setState({
settings: settings,
changedSettingKeys: changedSettingKeys,
return {
settings: settings,
changedSettingKeys: changedSettingKeys,
};
});
};