authorgravatar for 93147993+hey-jj@users.noreply.github.comJJ <93147993+hey-jj@users.noreply.github.com> 2026-08-15 05:41:51-06:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-15 11:41:51+00:00
log3bc4fdf05b6b748a7b506c81dc125f3504f35278
treef69af34ca5cda6fd42f1d1bbf5eb13fd57c26966
parentdb3278f97721f89b8b11a28bf59e59ce1fb68598
signature Signed by PGP key B5690EEEBB952194

fix(mobile): recover the QR pairing scanner when camera access is denied (#6487)


1 files changed, 14 insertions(+), 2 deletions(-)

apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx+14-2
...@@ -3,7 +3,7 @@ import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/Stac...@@ -3,7 +3,7 @@ import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/Stac
3import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";3import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
4import { AsyncResult } from "effect/unstable/reactivity";4import { AsyncResult } from "effect/unstable/reactivity";
5import { useCallback, useEffect, useRef, useState } from "react";5import { useCallback, useEffect, useRef, useState } from "react";
6import { Alert, Platform, ScrollView, View } from "react-native";6import { Alert, Linking, Platform, ScrollView, View } from "react-native";
7import { useSafeAreaInsets } from "react-native-safe-area-context";7import { useSafeAreaInsets } from "react-native-safe-area-context";
8import { useThemeColor } from "../../lib/useThemeColor";8import { useThemeColor } from "../../lib/useThemeColor";
99
...@@ -95,9 +95,21 @@ export function ConnectionsNewRouteScreen({...@@ -95,9 +95,21 @@ export function ConnectionsNewRouteScreen({
95 return;95 return;
96 }96 }
9797
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]);
103115