aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/app/sharing.tsx
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-15 16:34:42 +0000
committerMohamedBassem <me@mbassem.com>2024-03-15 16:34:42 +0000
commitf922e1650df550b3dec2f010ffdc6c15ea11390d (patch)
treed09c3ce868429c84473f7aa5f450d75521ee7162 /apps/mobile/app/sharing.tsx
parent49f44900cb553905bdb565ae12cb09676d93d4fc (diff)
downloadkarakeep-f922e1650df550b3dec2f010ffdc6c15ea11390d.tar.zst
fix(mobile): Bump expo-share-intent version and remove the hacks around the old version
Diffstat (limited to 'apps/mobile/app/sharing.tsx')
-rw-r--r--apps/mobile/app/sharing.tsx21
1 files changed, 4 insertions, 17 deletions
diff --git a/apps/mobile/app/sharing.tsx b/apps/mobile/app/sharing.tsx
index f9f423b5..e8b0ad09 100644
--- a/apps/mobile/app/sharing.tsx
+++ b/apps/mobile/app/sharing.tsx
@@ -1,8 +1,7 @@
-import type { ShareIntent } from "expo-share-intent";
-import { useEffect, useMemo, useState } from "react";
+import { useEffect, useState } from "react";
import { Text, View } from "react-native";
-import { Link, useLocalSearchParams, useRouter } from "expo-router";
-import { useShareIntent } from "expo-share-intent";
+import { Link, useRouter } from "expo-router";
+import { useShareIntentContext } from "expo-share-intent";
import { api } from "@/lib/trpc";
import { z } from "zod";
@@ -12,19 +11,7 @@ type Mode =
| { type: "error" };
function SaveBookmark({ setMode }: { setMode: (mode: Mode) => void }) {
- // Desperate attempt to fix sharing duplication
- const { hasShareIntent, resetShareIntent } = useShareIntent();
-
- const params = useLocalSearchParams();
-
- const shareIntent = useMemo(() => {
- if (params?.shareIntent) {
- if (typeof params.shareIntent === "string") {
- return JSON.parse(params.shareIntent) as ShareIntent;
- }
- }
- return null;
- }, [params]);
+ const { hasShareIntent, shareIntent, resetShareIntent } = useShareIntentContext();
const invalidateAllBookmarks =
api.useUtils().bookmarks.getBookmarks.invalidate;