mobile: fix opening webclips

This commit is contained in:
Ammar Ahmed
2024-01-29 11:01:30 +05:00
parent ecad06d249
commit ba51e110ad
2 changed files with 9 additions and 4 deletions

View File

@@ -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(

View File

@@ -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