Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

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

JJ3bc4fdf05b6b
diff --git a/apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx b/apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx
index 37d53cbd8..7fa3c691b 100644
--- a/apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx
+++ b/apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx
@@ -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, useRef, 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";
@@ -95,9 +95,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]);