mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
core: merge remote attachment if local attachment doesn't exist
This commit is contained in:
@@ -39,7 +39,10 @@ export default class Attachments extends Collection {
|
||||
merge(localAttachment, remoteAttachment) {
|
||||
if (remoteAttachment.deleted) return remoteAttachment;
|
||||
|
||||
if (remoteAttachment.dateModified > localAttachment.dateModified)
|
||||
if (
|
||||
!localAttachment ||
|
||||
remoteAttachment.dateModified > localAttachment.dateModified
|
||||
)
|
||||
return remoteAttachment;
|
||||
|
||||
if (localAttachment && localAttachment.noteIds) {
|
||||
|
||||
Reference in New Issue
Block a user