Skip to content

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

mobile: fix webclip failed to load

ammarahm-ed64e8f8b9a9f4
diff --git a/apps/mobile/app/common/filesystem/download-attachment.js b/apps/mobile/app/common/filesystem/download-attachment.js
index 2e3ce8a44..600e0469c 100644
--- a/apps/mobile/app/common/filesystem/download-attachment.js
+++ b/apps/mobile/app/common/filesystem/download-attachment.js
@@ -115,43 +115,3 @@ export default async function downloadAttachment(hash, global = true) {
}
}
-
-export default async function readAttachment(hash) {
- let attachment = db.attachments.attachment(hash);
- if (!attachment) {
- console.log("attachment not found");
- return;
- }
-
- try {
- await db.fs.downloadFile(
- attachment.metadata.hash,
- attachment.metadata.hash
- );
- if (
- !(await RNFetchBlob.fs.exists(`${cacheDir}/${attachment.metadata.hash}`))
- )
- return;
-
- let key = await db.attachments.decryptKey(attachment.key);
- let info = {
- iv: attachment.iv,
- salt: attachment.salt,
- length: attachment.length,
- alg: attachment.alg,
- hash: attachment.metadata.hash,
- hashType: attachment.metadata.hashType,
- mime: attachment.metadata.type,
- fileName: attachment.metadata.filename,
- chunkSize: attachment.chunkSize
- };
- return await Sodium.decryptFile(key, info, "text");
- } catch (e) {
- console.log("download attachment error: ", e);
- if (attachment.dateUploaded) {
- RNFetchBlob.fs
- .unlink(RNFetchBlob.fs.dirs.CacheDir + `/${attachment.metadata.hash}`)
- .catch(console.log);
- }
- }
-}
diff --git a/apps/mobile/app/screens/editor/index.tsx b/apps/mobile/app/screens/editor/index.tsx
index eae8f4af6..e9206c415 100755
--- a/apps/mobile/app/screens/editor/index.tsx
+++ b/apps/mobile/app/screens/editor/index.tsx
@@ -176,6 +176,7 @@ const Editor = React.memo(
allowFileAccess={true}
scalesPageToFit={true}
hideKeyboardAccessoryView={false}
+ allowsFullscreenVideo={true}
allowFileAccessFromFileURLs={true}
allowUniversalAccessFromFileURLs={true}
originWhitelist={["*"]}
diff --git a/apps/mobile/app/screens/editor/tiptap/commands.ts b/apps/mobile/app/screens/editor/tiptap/commands.ts
index 974a35b1c..4694ea1cb 100644
--- a/apps/mobile/app/screens/editor/tiptap/commands.ts
+++ b/apps/mobile/app/screens/editor/tiptap/commands.ts
@@ -218,7 +218,7 @@ typeof globalThis.statusBar !== "undefined" && statusBar.current.set({date:"",sa
updateWebclip = async ({ src, hash }: ImageAttributes) => {
await this.doAsync(
- `editor && editor.commands.updateWebclip(${JSON.stringify({
+ `editor && editor.commands.updateWebClip(${JSON.stringify({
hash
})},${JSON.stringify({ src })})`
);