diff --git a/app/(auth)/(tabs)/(home)/_layout.tsx b/app/(auth)/(tabs)/(home)/_layout.tsx index 763b89c9..f51ecbf5 100644 --- a/app/(auth)/(tabs)/(home)/_layout.tsx +++ b/app/(auth)/(tabs)/(home)/_layout.tsx @@ -1,12 +1,14 @@ import { Chromecast } from "@/components/Chromecast"; import { HeaderBackButton } from "@/components/common/HeaderBackButton"; import { nestedTabPageScreenOptions } from "@/components/stacks/NestedTabPageStack"; +import { useDownload } from "@/providers/DownloadProvider"; import { Feather } from "@expo/vector-icons"; import { Stack, useRouter } from "expo-router"; import { Platform, TouchableOpacity, View } from "react-native"; export default function IndexLayout() { const router = useRouter(); + return ( (null); const [loadingRetry, setLoadingRetry] = useState(false); + const { downloadedFiles } = useDownload(); + const navigation = useNavigation(); + + useEffect(() => { + const hasDownloads = downloadedFiles && downloadedFiles.length > 0; + navigation.setOptions({ + headerLeft: () => ( + { + router.push("/(auth)/downloads"); + }} + className="p-2" + > + + + ), + }); + }, [downloadedFiles, navigation, router]); + const checkConnection = useCallback(async () => { setLoadingRetry(true); const state = await NetInfo.fetch(); diff --git a/bun.lockb b/bun.lockb index c717c667..de0709bd 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/FullScreenVideoPlayer.tsx b/components/FullScreenVideoPlayer.tsx index d19a65eb..9453c2b3 100644 --- a/components/FullScreenVideoPlayer.tsx +++ b/components/FullScreenVideoPlayer.tsx @@ -32,7 +32,7 @@ import { useSharedValue, } from "react-native-reanimated"; import { useSafeAreaInsets } from "react-native-safe-area-context"; -import Video, { OnProgressData } from "react-native-video"; +import Video, { OnProgressData, ReactVideoProps } from "react-native-video"; import { Text } from "./common/Text"; import { itemRouter } from "./common/TouchableItemRouter"; import { Loader } from "./Loader"; @@ -199,8 +199,8 @@ export const FullScreenVideoPlayer: React.FC = () => { }); }, [currentlyPlaying?.item, api]); - const videoSource = useMemo(() => { - if (!api || !currentlyPlaying || !poster) return null; + const videoSource: ReactVideoProps["source"] = useMemo(() => { + if (!api || !currentlyPlaying || !poster) return undefined; const startPosition = currentlyPlaying.item?.UserData?.PlaybackPositionTicks ? Math.round(currentlyPlaying.item.UserData.PlaybackPositionTicks / 10000) : 0; @@ -342,24 +342,25 @@ export const FullScreenVideoPlayer: React.FC = () => { }, ]} > - {videoSource && ( -