From 847deb0b420a47c25f5d9699183fad93021ecc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= <100827540+reneaaron@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:55:27 +0200 Subject: [PATCH] fix: prevent camera permission prompt (#80) --- app/_layout.tsx | 17 ++++++++--------- pages/Home.tsx | 3 +-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/_layout.tsx b/app/_layout.tsx index 2770c62..4a6de40 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -53,7 +53,7 @@ export default function RootLayout() { const rootNavigationState = useRootNavigationState(); const hasNavigationState = !!rootNavigationState?.key; - async function checkOnboardingStatus() { + async function checkOnboardingStatus() { const hasOnboarded = await secureStorage.getItem(hasOnboardedKey); if (!hasOnboarded && hasNavigationState) { router.replace("/onboarding"); @@ -64,14 +64,14 @@ export default function RootLayout() { async function loadFonts() { - await Font.loadAsync({ - OpenRunde: require("./../assets/fonts/OpenRunde-Regular.otf"), - "OpenRunde-Medium": require("./../assets/fonts/OpenRunde-Medium.otf"), - "OpenRunde-Semibold": require("./../assets/fonts/OpenRunde-Semibold.otf"), - "OpenRunde-Bold": require("./../assets/fonts/OpenRunde-Bold.otf"), - }); + await Font.loadAsync({ + OpenRunde: require("./../assets/fonts/OpenRunde-Regular.otf"), + "OpenRunde-Medium": require("./../assets/fonts/OpenRunde-Medium.otf"), + "OpenRunde-Semibold": require("./../assets/fonts/OpenRunde-Semibold.otf"), + "OpenRunde-Bold": require("./../assets/fonts/OpenRunde-Bold.otf"), + }); - setFontsLoaded(true); + setFontsLoaded(true); } React.useEffect(() => { @@ -83,7 +83,6 @@ export default function RootLayout() { ]); } finally { - SplashScreen.hideAsync(); } }; diff --git a/pages/Home.tsx b/pages/Home.tsx index 30a10fc..816663f 100644 --- a/pages/Home.tsx +++ b/pages/Home.tsx @@ -39,7 +39,6 @@ export function Home() { const [balanceState, setBalanceState] = useState( BalanceState.SATS, ); - const [pressed, setPressed] = React.useState(false); const rootNavigationState = useRootNavigationState(); const isOnboarded = useOnboarding(); @@ -55,7 +54,7 @@ export function Home() { } }, [hasNwcClient, hasNavigationState, isOnboarded]); - if (!nwcClient) { + if (!nwcClient && isOnboarded) { return ; }