aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile
diff options
context:
space:
mode:
authorAhmad Mujahid <55625580+AhmadMuj@users.noreply.github.com>2024-04-11 15:29:51 +0400
committerGitHub <noreply@github.com>2024-04-11 14:29:51 +0300
commitbe622e5594ecb21c82bb6066a82c86e0917bcc35 (patch)
treee77973630b30bb5d51abc2ade6993c523a8413b9 /apps/mobile
parent2806701318dff77b10a5574d4b26ef6032f6b9bc (diff)
downloadkarakeep-be622e5594ecb21c82bb6066a82c86e0917bcc35.tar.zst
feature: Add PDF support (#88)
* feature: Add PDF support * fix: PDF feature enhancements * fix: Freeze expo-share-intent version to prevent breaking changes * fix: set endOfLine to auto for cross-platform development * fix: Upgrading eslint/parser and eslint-plugin to 7.6.0 to solve the linting issues * fix: enhancing PDF feature * fix: Allowing null in fiename for backward compatibility * fix: update pnpm file with pnpm 9.0.0-alpha-8 * fix:(web): PDF Preview for web
Diffstat (limited to 'apps/mobile')
-rw-r--r--apps/mobile/lib/upload.ts6
-rw-r--r--apps/mobile/package.json2
2 files changed, 5 insertions, 3 deletions
diff --git a/apps/mobile/lib/upload.ts b/apps/mobile/lib/upload.ts
index 56b2c7a5..f9d05967 100644
--- a/apps/mobile/lib/upload.ts
+++ b/apps/mobile/lib/upload.ts
@@ -38,7 +38,7 @@ export function useUploadAsset(
mutationFn: async (file: { type: string; name: string; uri: string }) => {
const formData = new FormData();
// @ts-expect-error This is a valid api in react native
- formData.append("image", {
+ formData.append("file", {
uri: file.uri,
name: file.name,
type: file.type,
@@ -57,7 +57,9 @@ export function useUploadAsset(
},
onSuccess: (resp) => {
const assetId = resp.assetId;
- createBookmark({ type: "asset", assetId, assetType: "image" });
+ const assetType =
+ resp.contentType === "application/pdf" ? "pdf" : "image";
+ createBookmark({ type: "asset", assetId, assetType });
},
onError: (e) => {
if (options.onError) {
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index 9f170040..248f1f53 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -31,7 +31,7 @@
"expo-navigation-bar": "~2.8.1",
"expo-router": "~3.4.8",
"expo-secure-store": "^12.8.1",
- "expo-share-intent": "^1.1.0",
+ "expo-share-intent": "1.1.0",
"expo-status-bar": "~1.11.1",
"expo-system-ui": "^2.9.3",
"expo-web-browser": "^12.8.2",