From 74ce9d7eea10737aee1ac3f8b4829f16abbb964a Mon Sep 17 00:00:00 2001 From: sarendsen Date: Mon, 6 Jan 2025 14:28:24 +0100 Subject: [PATCH] wip --- app/(auth)/(tabs)/(home)/index.tsx | 15 ++++++++------- .../{ContextMenu.native.ts => ContextMenu.tv.ts} | 0 ...{DropdownMenu.native.ts => DropdownMenu.tv.ts} | 0 ...{expo-haptics.native.ts => expo-haptics.tv.ts} | 0 packages/expo-screen-orientation.ts | 1 + ...on.native.ts => expo-screen-orientation.tv.ts} | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) rename components/{ContextMenu.native.ts => ContextMenu.tv.ts} (100%) rename components/{DropdownMenu.native.ts => DropdownMenu.tv.ts} (100%) rename packages/{expo-haptics.native.ts => expo-haptics.tv.ts} (100%) rename packages/{expo-screen-orientation.native.ts => expo-screen-orientation.tv.ts} (98%) diff --git a/app/(auth)/(tabs)/(home)/index.tsx b/app/(auth)/(tabs)/(home)/index.tsx index 98c1603d..2f74e55e 100644 --- a/app/(auth)/(tabs)/(home)/index.tsx +++ b/app/(auth)/(tabs)/(home)/index.tsx @@ -69,9 +69,9 @@ export default function index() { const insets = useSafeAreaInsets(); - if (!Platform.isTV) { - const { downloadedFiles, cleanCacheDirectory } = useDownload(); + const { downloadedFiles, cleanCacheDirectory } = useDownload(); + if (!Platform.isTV) { useEffect(() => { const hasDownloads = downloadedFiles && downloadedFiles.length > 0; navigation.setOptions({ @@ -91,6 +91,12 @@ export default function index() { ), }); }, [downloadedFiles, navigation, router]); + + useEffect(() => { + cleanCacheDirectory().catch((e) => + console.error("Something went wrong cleaning cache directory") + ); + }, []); } const checkConnection = useCallback(async () => { @@ -111,11 +117,6 @@ export default function index() { setIsConnected(state.isConnected); }); - if (!Platform.isTV) { - cleanCacheDirectory().catch((e) => - console.error("Something went wrong cleaning cache directory") - ); - } return () => { unsubscribe(); }; diff --git a/components/ContextMenu.native.ts b/components/ContextMenu.tv.ts similarity index 100% rename from components/ContextMenu.native.ts rename to components/ContextMenu.tv.ts diff --git a/components/DropdownMenu.native.ts b/components/DropdownMenu.tv.ts similarity index 100% rename from components/DropdownMenu.native.ts rename to components/DropdownMenu.tv.ts diff --git a/packages/expo-haptics.native.ts b/packages/expo-haptics.tv.ts similarity index 100% rename from packages/expo-haptics.native.ts rename to packages/expo-haptics.tv.ts diff --git a/packages/expo-screen-orientation.ts b/packages/expo-screen-orientation.ts index 7b29bfe1..5978df82 100644 --- a/packages/expo-screen-orientation.ts +++ b/packages/expo-screen-orientation.ts @@ -1 +1,2 @@ export * from "expo-screen-orientation"; +console.log("LOADED"); diff --git a/packages/expo-screen-orientation.native.ts b/packages/expo-screen-orientation.tv.ts similarity index 98% rename from packages/expo-screen-orientation.native.ts rename to packages/expo-screen-orientation.tv.ts index b658398b..8bd1d5ca 100644 --- a/packages/expo-screen-orientation.native.ts +++ b/packages/expo-screen-orientation.tv.ts @@ -1,5 +1,5 @@ // export { Orientation, OrientationLock } from "expo-screen-orientation"; - +console.log("NOT"); export enum Orientation { /** * An unknown screen orientation. For example, the device is flat, perhaps on a table.