From 3a3410863faa86e36a08de024157d93c682a4e19 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 14 Mar 2024 00:00:28 -0700 Subject: [PATCH] add a test --- src/App.native.tsx | 2 +- src/view/screens/Home.tsx | 34 ++++------------------------------ 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/src/App.native.tsx b/src/App.native.tsx index 3e14fca1eb..ba4e6e9f10 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -59,7 +59,7 @@ function InnerApp() { const theme = useColorModeTheme() const {_} = useLingui() useIntentHandler() - // useUpdateCheck() + useUpdateCheck() // init useEffect(() => { diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index ac02f57b8e..266ecee366 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -18,7 +18,6 @@ import {emitSoftReset} from '#/state/events' import {useSession} from '#/state/session' import {useSelectedFeed, useSetSelectedFeed} from '#/state/shell/selected-feed' import {useSetTitle} from '#/lib/hooks/useSetTitle' -import * as Updates from 'expo-updates' type Props = NativeStackScreenProps export function HomeScreen(props: Props) { @@ -63,35 +62,10 @@ function HomeScreenReady({ }, [pinnedFeedInfos]) React.useEffect(() => { - Alert.alert('Final test. If you see this, it works.') - ;(async () => { - try { - const update = await Updates.checkForUpdateAsync() - - if (update.isAvailable) { - Alert.alert( - 'Update is available!', - 'Do you want to install it now?', - [ - { - text: 'Cancel', - style: 'cancel', - }, - { - text: 'Install', - style: 'default', - onPress: async () => { - await Updates.fetchUpdateAsync() - await Updates.reloadAsync() - }, - }, - ], - ) - } - } catch (error) { - Alert.alert('Error', `${error}`) - } - })() + Alert.alert( + 'OTA Update Test', + 'After seeing this message:\n\n1. Dismiss the alert\n2. Force quit and restart the app.\n\nYou should not see this message again. If you do, then the update failed.', + ) }, []) const rawSelectedFeed = useSelectedFeed()