Skip to content

Commit

Permalink
fix 🐛(llm) qr code scanner crash
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey committed Dec 24, 2024
1 parent 80f5a8f commit d5c6eb6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-hornets-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

fix qr code scanner crash
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,22 @@ const ScanQrCode = ({ onQrCodeScanned }: Props) => {
alignItems={"center"}
>
<CameraPermissionContext.Consumer>
{({ permissionGranted }) => (
<CameraView
active={permissionGranted ?? false}
style={{
backgroundColor: colors.neutral.c50,
width: 280,
height: 280,
}}
barcodeScannerSettings={{
barcodeTypes: ["qr"],
}}
onBarcodeScanned={onBarCodeScanned}
/>
)}
{({ permissionGranted }) =>
permissionGranted ? (
<CameraView
active={permissionGranted ?? false}
style={{
backgroundColor: colors.neutral.c50,
width: 280,
height: 280,
}}
barcodeScannerSettings={{
barcodeTypes: ["qr"],
}}
onBarcodeScanned={onBarCodeScanned}
/>
) : null
}
</CameraPermissionContext.Consumer>
<ScanTargetSvg style={{ position: "absolute" }} />
</Flex>
Expand Down

0 comments on commit d5c6eb6

Please sign in to comment.