Skip to content
Open
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
16 changes: 14 additions & 2 deletions apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/Stac
import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
import { AsyncResult } from "effect/unstable/reactivity";
import { useCallback, useEffect, useState } from "react";
import { Alert, Platform, ScrollView, View } from "react-native";
import { Alert, Linking, Platform, ScrollView, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useThemeColor } from "../../lib/useThemeColor";

Expand Down Expand Up @@ -76,9 +76,21 @@ export function ConnectionsNewRouteScreen({
return;
}

if (permission.canAskAgain) {
Alert.alert(
"Camera access needed",
"Allow camera access to scan an environment pairing QR code.",
);
return;
}

Alert.alert(
"Camera access needed",
"Allow camera access to scan an environment pairing QR code.",
"Camera access was denied for this app. Open Settings to enable it.",
[
{ text: "Cancel", style: "cancel" },
{ text: "Open Settings", onPress: () => void Linking.openSettings() },
],
);
}, [cameraPermission?.granted, requestCameraPermission]);

Expand Down
Loading