Skip to content

Commit

Permalink
fix: prevent camera permission prompt (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
reneaaron authored Sep 3, 2024
1 parent e683d9b commit 847deb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
17 changes: 8 additions & 9 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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(() => {
Expand All @@ -83,7 +83,6 @@ export default function RootLayout() {
]);
}
finally {

SplashScreen.hideAsync();
}
};
Expand Down
3 changes: 1 addition & 2 deletions pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export function Home() {
const [balanceState, setBalanceState] = useState<BalanceState>(
BalanceState.SATS,
);
const [pressed, setPressed] = React.useState(false);
const rootNavigationState = useRootNavigationState();
const isOnboarded = useOnboarding();

Expand All @@ -55,7 +54,7 @@ export function Home() {
}
}, [hasNwcClient, hasNavigationState, isOnboarded]);

if (!nwcClient) {
if (!nwcClient && isOnboarded) {
return <WalletConnection />;
}

Expand Down

0 comments on commit 847deb0

Please sign in to comment.