Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: simplify content exists check

thecodrr5c12db71754c
diff --git a/packages/core/collections/content.js b/packages/core/collections/content.js
index c70c88c14..875cdf645 100644
--- a/packages/core/collections/content.js
+++ b/packages/core/collections/content.js
@@ -7,9 +7,10 @@ export default class Content extends Collection {
if (content.deleted || content.migrated)
return await this._collection.addItem(content);
- if (content.id && (await this._collection.exists(content.id))) {
+ const oldContent = await this.raw(content.id);
+ if (content.id && oldContent) {
content = {
- ...(await this.raw(content.id)),
+ ...oldContent,
...content,
};
}