From f09e5cadcfdb42ed95c8d21f2c2cc748351db4f6 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Mon, 30 Dec 2024 14:35:10 +0500 Subject: [PATCH] mobile: fix image and file uploads --- apps/mobile/app/screens/editor/tiptap/picker.ts | 2 +- apps/mobile/app/utils/note-bundle.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/mobile/app/screens/editor/tiptap/picker.ts b/apps/mobile/app/screens/editor/tiptap/picker.ts index 34a78472ab..952d841334 100644 --- a/apps/mobile/app/screens/editor/tiptap/picker.ts +++ b/apps/mobile/app/screens/editor/tiptap/picker.ts @@ -388,7 +388,6 @@ export async function attachFile( encryptionInfo.mimeType = type; encryptionInfo.filename = filename; encryptionInfo.alg = "xcha-stream"; - encryptionInfo.size = encryptionInfo.length; encryptionInfo.key = key; if (options?.reupload && exists) { const attachment = await db.attachments.attachment(hash); @@ -397,6 +396,7 @@ export async function attachFile( } else { encryptionInfo = { hash: hash }; } + console.log("FILE ENCRYPTED....", encryptionInfo); await db.attachments.add(encryptionInfo); return true; } catch (e) { diff --git a/apps/mobile/app/utils/note-bundle.js b/apps/mobile/app/utils/note-bundle.js index 6b46503541..9cd7359e67 100644 --- a/apps/mobile/app/utils/note-bundle.js +++ b/apps/mobile/app/utils/note-bundle.js @@ -48,7 +48,6 @@ export async function attachFile(uri, hash, type, filename, options) { encryptionInfo.mimeType = type; encryptionInfo.filename = filename; encryptionInfo.alg = "xcha-stream"; - encryptionInfo.size = encryptionInfo.length; encryptionInfo.key = key; console.log(encryptionInfo); if (options?.reupload && exists) await db.attachments.reset(hash);