mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fix
This commit is contained in:
parent
7a40072f1a
commit
94a89790dc
@ -35,7 +35,7 @@ export default class QrScanner extends Component {
|
||||
}
|
||||
this.codeReader = null
|
||||
this.permissionChecker = null
|
||||
this.notAllowed = false
|
||||
this.needsToReinit = false
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
@ -52,6 +52,10 @@ export default class QrScanner extends Component {
|
||||
ready: true,
|
||||
msg: this.context.t('scanInstructions'),
|
||||
})
|
||||
if (this.needsToReinit) {
|
||||
this.initCamera()
|
||||
this.needsToReinit = false
|
||||
}
|
||||
}, 2000)
|
||||
} else {
|
||||
// Keep checking for permissions
|
||||
@ -88,6 +92,7 @@ export default class QrScanner extends Component {
|
||||
if (err && err.name === 'NotAllowedError') {
|
||||
this.setState({msg: this.context.t('youNeedToAllowCameraAccess')})
|
||||
clearTimeout(this.permissionChecker)
|
||||
this.needsToReinit = true
|
||||
this.checkPermisisions()
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user