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

All: Handle conflict for encrypted notes

This commit is contained in:
Laurent Cozic
2017-12-13 22:53:20 +00:00
parent c6ff14226f
commit bd20ecff78
2 changed files with 44 additions and 13 deletions

View File

@@ -438,6 +438,10 @@ class Note extends BaseItem {
// That shouldn't happen so throw an exception
if (localNote.id !== remoteNote.id) throw new Error('Cannot handle conflict for two different notes');
// For encrypted notes the conflict must always be handled
if (localNote.encryption_cipher_text || remoteNote.encryption_cipher_text) return true;
// Otherwise only handle the conflict if there's a different on the title or body
if (localNote.title !== remoteNote.title) return true;
if (localNote.body !== remoteNote.body) return true;