| ... | @@ -3,7 +3,7 @@ import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/Stac | ... | @@ -3,7 +3,7 @@ import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/Stac |
| 3 | import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native"; | 3 | import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native"; |
| 4 | import { AsyncResult } from "effect/unstable/reactivity"; | 4 | import { AsyncResult } from "effect/unstable/reactivity"; |
| 5 | import { useCallback, useEffect, useRef, useState } from "react"; | 5 | import { useCallback, useEffect, useRef, useState } from "react"; |
| 6 | import { Alert, Platform, ScrollView, View } from "react-native"; | 6 | import { Alert, Linking, Platform, ScrollView, View } from "react-native"; |
| 7 | import { useSafeAreaInsets } from "react-native-safe-area-context"; | 7 | import { useSafeAreaInsets } from "react-native-safe-area-context"; |
| 8 | import { useThemeColor } from "../../lib/useThemeColor"; | 8 | import { useThemeColor } from "../../lib/useThemeColor"; |
| 9 | | 9 | |
| ... | @@ -95,9 +95,21 @@ export function ConnectionsNewRouteScreen({ | ... | @@ -95,9 +95,21 @@ export function ConnectionsNewRouteScreen({ |
| 95 | return; | 95 | return; |
| 96 | } | 96 | } |
| 97 | | 97 | |
| | 98 | if (permission.canAskAgain) { |
| | 99 | Alert.alert( |
| | 100 | "Camera access needed", |
| | 101 | "Allow camera access to scan an environment pairing QR code.", |
| | 102 | ); |
| | 103 | return; |
| | 104 | } |
| | 105 | |
| 98 | Alert.alert( | 106 | Alert.alert( |
| 99 | "Camera access needed", | 107 | "Camera access needed", |
| 100 | "Allow camera access to scan an environment pairing QR code.", | 108 | "Camera access was denied for this app. Open Settings to enable it.", |
| | 109 | [ |
| | 110 | { text: "Cancel", style: "cancel" }, |
| | 111 | { text: "Open Settings", onPress: () => void Linking.openSettings() }, |
| | 112 | ], |
| 101 | ); | 113 | ); |
| 102 | }, [cameraPermission?.granted, requestCameraPermission]); | 114 | }, [cameraPermission?.granted, requestCameraPermission]); |
| 103 | | 115 | |