You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
Server: Add support for sharing notes via a link
This commit is contained in:
@ -3,7 +3,6 @@ const SyncTargetRegistry = require('../../SyncTargetRegistry');
|
||||
const ObjectUtils = require('../../ObjectUtils');
|
||||
const { _ } = require('../../locale');
|
||||
const { createSelector } = require('reselect');
|
||||
const { reg } = require('../../registry');
|
||||
|
||||
const shared = {};
|
||||
|
||||
@ -32,7 +31,7 @@ shared.checkSyncConfig = async function(comp, settings) {
|
||||
comp.setState({ checkSyncConfigResult: result });
|
||||
|
||||
if (result.ok) {
|
||||
await shared.checkNextcloudApp(comp, settings);
|
||||
// await shared.checkNextcloudApp(comp, settings);
|
||||
// Users often expect config to be auto-saved at this point, if the config check was successful
|
||||
shared.saveSettings(comp);
|
||||
}
|
||||
@ -54,30 +53,6 @@ shared.checkSyncConfigMessages = function(comp) {
|
||||
return output;
|
||||
};
|
||||
|
||||
shared.checkNextcloudApp = async function(comp, settings) {
|
||||
if (settings['sync.target'] !== 5) return;
|
||||
|
||||
comp.setState({ checkNextcloudAppResult: 'checking' });
|
||||
let result = null;
|
||||
const appApi = await reg.syncTargetNextcloud().appApi(settings);
|
||||
|
||||
try {
|
||||
result = await appApi.setupSyncTarget(settings['sync.5.path']);
|
||||
} catch (error) {
|
||||
reg.logger().error('Could not setup sync target:', error);
|
||||
result = { error: error.message };
|
||||
}
|
||||
|
||||
const newSyncTargets = Object.assign({}, settings['sync.5.syncTargets']);
|
||||
newSyncTargets[settings['sync.5.path']] = result;
|
||||
shared.updateSettingValue(comp, 'sync.5.syncTargets', newSyncTargets);
|
||||
|
||||
// Also immediately save the result as this is most likely what the user would expect
|
||||
Setting.setValue('sync.5.syncTargets', newSyncTargets);
|
||||
|
||||
comp.setState({ checkNextcloudAppResult: 'done' });
|
||||
};
|
||||
|
||||
shared.updateSettingValue = function(comp, key, value) {
|
||||
comp.setState(state => {
|
||||
const settings = Object.assign({}, state.settings);
|
||||
|
Reference in New Issue
Block a user