core: fix notes marked as local only get deleted

on sync
This commit is contained in:
ammarahm-ed
2023-04-07 15:29:25 +05:00
committed by Ammar Ahmed
parent cf2f4c4bbb
commit cc58351731
2 changed files with 8 additions and 2 deletions

View File

@@ -85,7 +85,8 @@ class Collector {
result.items.push({
id: item.id,
deleted: true,
dateModified: Date.now()
dateModified: item.dateModified,
deleteReason: "localOnly"
});
result.types.push(itemType);
} else if (isUnsynced && isSyncable) {

View File

@@ -56,7 +56,12 @@ export default class Notes extends Collection {
}
}
if (remoteNote.deleted) return await this._collection.addItem(remoteNote);
if (
remoteNote.deleted &&
remoteNote.deleteReason !== "localOnly" &&
!localNote.localOnly
)
return await this._collection.addItem(remoteNote);
await this._resolveColorAndTags(remoteNote);