diff --git a/apps/expo/src/app/(tabs)/_layout.tsx b/apps/expo/src/app/(tabs)/_layout.tsx index d6829b5..b866b3e 100644 --- a/apps/expo/src/app/(tabs)/_layout.tsx +++ b/apps/expo/src/app/(tabs)/_layout.tsx @@ -1,8 +1,6 @@ -import { useEffect } from "react"; import { Platform } from "react-native"; import * as Haptics from "expo-haptics"; -import * as Linking from "expo-linking"; -import { Tabs, useRouter } from "expo-router"; +import { Tabs } from "expo-router"; import * as ScreenOrientation from "expo-screen-orientation"; import { useTheme, View } from "tamagui"; @@ -12,23 +10,6 @@ import TabBarIcon from "~/components/TabBarIcon"; export default function TabLayout() { const theme = useTheme(); - - const router = useRouter(); - - useEffect(() => { - const handleOpenURL = (event: Linking.EventType) => { - const { hostname, queryParams } = Linking.parse(event.url); - if (hostname === "media") { - router.push({ - pathname: "/videoPlayer", - params: { data: JSON.stringify(queryParams) }, - }); - } - }; - - Linking.addEventListener("url", handleOpenURL); - }, [router]); - return ( ) - : undefined; + let data; + if ("data" in params) { + if (typeof params.data === "string") { + data = JSON.parse(params.data) as Partial; + } else { + data = undefined; + } + } else { + data = params as Partial; + } const media = params.media ? (JSON.parse(params.media as string) as ScrapeMedia) : undefined;