Skip to content

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

core: do not download media for text exports

ammarahm-ed01cb43ba2ecd
diff --git a/packages/core/models/note.js b/packages/core/models/note.js
index 85471b7b2..e6ea807d4 100644
--- a/packages/core/models/note.js
+++ b/packages/core/models/note.js
@@ -102,12 +102,19 @@ export default class Note {
type: "tiptap",
data: "<p></p>"
};
- const { data, type } = await this._db.content.downloadMedia(
- `export-${this.id}`,
- contentItem,
- false
- );
- let content = getContentFromData(type, data);
+
+ let content;
+
+ if (to !== "txt") {
+ const { data, type } = await this._db.content.downloadMedia(
+ `export-${this.id}`,
+ contentItem,
+ false
+ );
+ content = getContentFromData(type, data);
+ } else {
+ content = getContentFromData(contentItem.type, contentItem.data);
+ }
switch (to) {
case "html":