Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent camera permission prompt #80

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading