File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,10 @@ export const ScanModal: React.FC<Props> = props => {
7575 handleBarCodeRead ( codes )
7676 }
7777 } )
78- const cameraPermission = useSelector ( state => state . permissions . camera )
78+ const reduxCameraPermission = useSelector ( state => state . permissions . camera )
79+ const [ cameraPermission , setCameraPermission ] = React . useState (
80+ reduxCameraPermission
81+ )
7982 const [ torchEnabled , setTorchEnabled ] = React . useState ( false )
8083 const [ scanEnabled , setScanEnabled ] = React . useState ( false )
8184
@@ -87,7 +90,11 @@ export const ScanModal: React.FC<Props> = props => {
8790 // Mount effects
8891 React . useEffect ( ( ) => {
8992 setScanEnabled ( true )
90- checkAndRequestPermission ( 'camera' ) . catch ( showError )
93+ checkAndRequestPermission ( 'camera' )
94+ . then ( status => {
95+ setCameraPermission ( status )
96+ } )
97+ . catch ( showError )
9198 return ( ) => {
9299 setScanEnabled ( false )
93100 }
You can’t perform that action at this time.
0 commit comments