You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Fixed sync cancel
This commit is contained in:
		| @@ -76,7 +76,7 @@ class Command extends BaseCommand { | ||||
| 			this.syncTarget_ = Setting.value('sync.target'); | ||||
| 			if (args.options.target) this.syncTarget_ = args.options.target; | ||||
|  | ||||
| 			if (this.syncTarget_ == Setting.SYNC_TARGET_ONEDRIVE && !reg.oneDriveApi().auth()) { | ||||
| 			if (this.syncTarget_ == Setting.SYNC_TARGET_ONEDRIVE && !await reg.syncHasAuth(this.syncTarget_)) { | ||||
| 				const oneDriveApiUtils = new OneDriveApiNodeUtils(reg.oneDriveApi()); | ||||
| 				const auth = await oneDriveApiUtils.oauthDance(this); | ||||
| 				Setting.setValue('sync.3.auth', auth ? JSON.stringify(auth) : null); | ||||
| @@ -138,8 +138,14 @@ class Command extends BaseCommand { | ||||
|  | ||||
| 		vorpalUtils.redrawDone(); | ||||
| 		this.log(_('Cancelling...')); | ||||
|  | ||||
| 		if (await reg.syncHasAuth(target)) { | ||||
| 			let sync = await reg.synchronizer(target); | ||||
| 			if (sync) sync.cancel(); | ||||
| 		} else { | ||||
| 			if (this.releaseLockFn_) this.releaseLockFn_(); | ||||
| 			this.releaseLockFn_ = null; | ||||
| 		} | ||||
|  | ||||
| 		this.syncTarget_ = null; | ||||
| 	} | ||||
|   | ||||
| @@ -380,6 +380,27 @@ msgstr "" | ||||
| msgid "Non-completed ones only" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Show uncompleted todos on top of the lists" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Save location with notes" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Synchronisation interval" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d minutes" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d hour" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d hours" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Sync status (synced items / total items)" | ||||
| msgstr "" | ||||
|  | ||||
|   | ||||
| @@ -415,6 +415,28 @@ msgstr "Tâches non-complétées et récentes" | ||||
| msgid "Non-completed ones only" | ||||
| msgstr "Tâche complétée seulement" | ||||
|  | ||||
| msgid "Show uncompleted todos on top of the lists" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Save location with notes" | ||||
| msgstr "" | ||||
|  | ||||
| #, fuzzy | ||||
| msgid "Synchronisation interval" | ||||
| msgstr "Cible de la synchronisation" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d minutes" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d hour" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d hours" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Sync status (synced items / total items)" | ||||
| msgstr "Status de la synchronisation (objets synchro. / total)" | ||||
|  | ||||
|   | ||||
| @@ -380,6 +380,27 @@ msgstr "" | ||||
| msgid "Non-completed ones only" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Show uncompleted todos on top of the lists" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Save location with notes" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Synchronisation interval" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d minutes" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d hour" | ||||
| msgstr "" | ||||
|  | ||||
| #, javascript-format | ||||
| msgid "%d hours" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "Sync status (synced items / total items)" | ||||
| msgstr "" | ||||
|  | ||||
|   | ||||
| @@ -136,7 +136,7 @@ class Synchronizer { | ||||
| 	} | ||||
|  | ||||
| 	cancel() { | ||||
| 		if (this.cancelling_) return; | ||||
| 		if (this.cancelling_ || this.state() == 'idle') return; | ||||
| 		 | ||||
| 		this.logSyncOperation('cancelling', null, null, ''); | ||||
| 		this.cancelling_ = true; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user