diff --git a/bun.lockb b/bun.lockb index 4c960d5..ebd5745 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/app/(tabs)/(library)/_layout.tsx b/src/app/(tabs)/(library)/_layout.tsx index 2073b45..bd323ea 100644 --- a/src/app/(tabs)/(library)/_layout.tsx +++ b/src/app/(tabs)/(library)/_layout.tsx @@ -1,6 +1,9 @@ import { useSessionStore } from "@/src/stores/session"; import { Redirect, Stack } from "expo-router"; +const getId = ({ params }: { params?: Record | undefined }) => + params?.id; + export default function AppLayout() { const session = useSessionStore((state) => state.session); @@ -11,10 +14,10 @@ export default function AppLayout() { return ( - - - - + + + + ); } diff --git a/src/app/(tabs)/(library)/media/[id].tsx b/src/app/(tabs)/(library)/media/[id].tsx index 77d236e..20eccb3 100644 --- a/src/app/(tabs)/(library)/media/[id].tsx +++ b/src/app/(tabs)/(library)/media/[id].tsx @@ -777,7 +777,7 @@ function OtherEditions({ { - router.push({ + router.navigate({ pathname: "/book/[id]", params: { id: media[0].book.id }, }); @@ -881,7 +881,7 @@ function OtherBooksInSeries({ { - router.push({ + router.navigate({ pathname: "/series/[id]", params: { id: series.id }, }); @@ -1038,7 +1038,7 @@ function OtherBooksByAuthor({ { - router.push({ + router.navigate({ pathname: "/person/[id]", params: { id: author.person.id }, }); @@ -1212,7 +1212,7 @@ function OtherMediaByNarrator({ { - router.push({ + router.navigate({ pathname: "/person/[id]", params: { id: narrator.person.id }, }); diff --git a/src/app/(tabs)/downloads.tsx b/src/app/(tabs)/downloads.tsx index fe56bf0..1586db2 100644 --- a/src/app/(tabs)/downloads.tsx +++ b/src/app/(tabs)/downloads.tsx @@ -82,7 +82,7 @@ function DownloadRow({ session, download }: DownloadRowProps) { const [isModalVisible, setIsModalVisible] = useState(false); const navigateToBook = () => { - router.push({ + router.navigate({ pathname: "/media/[id]", params: { id: download.media.id, diff --git a/src/app/+native-intent.tsx b/src/app/+native-intent.tsx new file mode 100644 index 0000000..029ced6 --- /dev/null +++ b/src/app/+native-intent.tsx @@ -0,0 +1,15 @@ +import { useTrackPlayerStore } from "@/src/stores/trackPlayer"; + +type PathArgs = { + path: string; + initial: boolean; +}; + +export function redirectSystemPath({ path }: PathArgs) { + if (path === "trackplayer://notification.click") { + useTrackPlayerStore.getState().requestExpandPlayer(); + return null; + } else { + return path; + } +} diff --git a/src/app/sign-in.tsx b/src/app/sign-in.tsx index 96d4a23..16c7e9b 100644 --- a/src/app/sign-in.tsx +++ b/src/app/sign-in.tsx @@ -6,7 +6,7 @@ import { useState } from "react"; import { Button, Text, TextInput, View } from "react-native"; import colors from "tailwindcss/colors"; -export default function SignIn() { +export default function SignInScreen() { const { session, error, isLoading, signIn, clearError } = useSessionStore( (state) => state, ); diff --git a/src/components/TabBarWithPlayer.tsx b/src/components/TabBarWithPlayer.tsx index 47195b9..ef34e94 100644 --- a/src/components/TabBarWithPlayer.tsx +++ b/src/components/TabBarWithPlayer.tsx @@ -62,8 +62,8 @@ export default function TabBarWithPlayer({ useEffect(() => { if (!expanded && lastPlayerExpandRequest) { expandLocal(); - expandPlayerHandled(); } + expandPlayerHandled(); }, [expandLocal, expanded, lastPlayerExpandRequest, expandPlayerHandled]); const tabBarHeight = 50 + insets.bottom; @@ -333,7 +333,7 @@ export default function TabBarWithPlayer({ } else { collapseLocal(); setTimeout(() => { - router.push({ + router.navigate({ pathname: "/media/[id]", params: { id: media.id, title: media.book.title }, }); @@ -400,7 +400,7 @@ export default function TabBarWithPlayer({ onPress={() => { collapseLocal(); setTimeout(() => { - router.push({ + router.navigate({ pathname: "/media/[id]", params: { id: media.id, title: media.book.title }, }); diff --git a/src/components/Tiles.tsx b/src/components/Tiles.tsx index 40a4902..4345e0a 100644 --- a/src/components/Tiles.tsx +++ b/src/components/Tiles.tsx @@ -94,12 +94,12 @@ export function Tile({ book, media, seriesBook, style }: TileProps) { const navigateToBook = () => { if (media.length === 1) { - router.push({ + router.navigate({ pathname: "/media/[id]", params: { id: media[0].id, title: book.title }, }); } else { - router.push({ + router.navigate({ pathname: "/book/[id]", params: { id: book.id, title: book.title }, }); @@ -148,7 +148,7 @@ export function PersonTile(props: PersonTileProps) { const router = useRouter(); const navigateToPerson = () => { - router.push({ + router.navigate({ pathname: "/person/[id]", params: { id: personId, title: realName }, });