mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
mobile: fix opening webclips
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user