Skip to content

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

core: fix attachment extraction for locked notes

Abdullah Attaaf6041128b5e
diff --git a/packages/core/src/api/vault.ts b/packages/core/src/api/vault.ts
index ece321bd4..17538fddb 100644
--- a/packages/core/src/api/vault.ts
+++ b/packages/core/src/api/vault.ts
@@ -24,7 +24,6 @@ import { tinyToTiptap } from "../migrations";
import { isCipher } from "../database/crypto";
import { EncryptedContentItem, Note } from "../types";
import {
- EMPTY_CONTENT,
isEncryptedContent,
isUnencryptedContent
} from "../collections/content";
@@ -304,13 +303,11 @@ export default class Vault {
data = rawContent.data;
type = rawContent.type;
} else if (data && type) {
- const content = await this.db.content.extractAttachments({
- ...EMPTY_CONTENT(id),
+ data = await this.db.content.extractAttachments({
data,
- type
+ type,
+ noteId: id
});
- data = content.data;
- type = content.type;
}
if (data && type)