Skip to content

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

mobile: fix opening webclips

Ammar Ahmedba51e110ada9
diff --git a/apps/mobile/app/common/filesystem/download-attachment.js b/apps/mobile/app/common/filesystem/download-attachment.js
index b97e0468c..575c9c1a6 100644
--- a/apps/mobile/app/common/filesystem/download-attachment.js
+++ b/apps/mobile/app/common/filesystem/download-attachment.js
@@ -183,7 +183,8 @@ export default async function downloadAttachment(
cache: false,
throwError: false,
groupId: undefined,
- base64: false
+ base64: false,
+ text: false
}
) {
await createCacheDir();
@@ -219,8 +220,11 @@ export default async function downloadAttachment(
return;
}
- if (options.base64) {
- return await db.attachments.read(attachment.metadata.hash, "base64");
+ if (options.base64 || options.text) {
+ return await db.attachments.read(
+ attachment.metadata.hash,
+ options.base64 ? "base64" : "text"
+ );
}
let filename = getFileNameWithExtension(
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts b/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts
index fb4fe28fe..230beb7c6 100644
--- a/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts
+++ b/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts
@@ -427,7 +427,8 @@ export const useEditorEvents = (
attachment.type
);
downloadAttachment(attachment.hash, true, {
- base64: true,
+ base64: attachment.type === "image",
+ text: attachment.type === "web-clip",
silent: true,
groupId: editor.note.current?.id,
cache: true