1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

All: Added "None" sync target to allow disabling synchronisation

This commit is contained in:
Laurent Cozic
2021-08-16 16:18:32 +01:00
parent fe4900d254
commit f5f05e6cc5
10 changed files with 165 additions and 20 deletions

View File

@ -1,6 +1,7 @@
import { utils, CommandRuntime, CommandDeclaration, CommandContext } from '../services/CommandService';
import { _ } from '../locale';
import { reg } from '../registry';
import Setting from '../models/Setting';
export const declaration: CommandDeclaration = {
name: 'synchronize',
@ -17,6 +18,14 @@ export const runtime = (): CommandRuntime => {
const action = syncStarted ? 'cancel' : 'start';
if (!Setting.value('sync.target')) {
context.dispatch({
type: 'DIALOG_OPEN',
name: 'syncWizard',
});
return 'init';
}
if (!(await reg.syncTarget().isAuthenticated())) {
if (reg.syncTarget().authRouteName()) {
utils.store.dispatch({