1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
This commit is contained in:
brunobar79 2018-07-31 18:58:54 -04:00
parent 7a40072f1a
commit 94a89790dc

View File

@ -35,7 +35,7 @@ export default class QrScanner extends Component {
} }
this.codeReader = null this.codeReader = null
this.permissionChecker = null this.permissionChecker = null
this.notAllowed = false this.needsToReinit = false
} }
componentDidMount () { componentDidMount () {
@ -52,6 +52,10 @@ export default class QrScanner extends Component {
ready: true, ready: true,
msg: this.context.t('scanInstructions'), msg: this.context.t('scanInstructions'),
}) })
if (this.needsToReinit) {
this.initCamera()
this.needsToReinit = false
}
}, 2000) }, 2000)
} else { } else {
// Keep checking for permissions // Keep checking for permissions
@ -88,6 +92,7 @@ export default class QrScanner extends Component {
if (err && err.name === 'NotAllowedError') { if (err && err.name === 'NotAllowedError') {
this.setState({msg: this.context.t('youNeedToAllowCameraAccess')}) this.setState({msg: this.context.t('youNeedToAllowCameraAccess')})
clearTimeout(this.permissionChecker) clearTimeout(this.permissionChecker)
this.needsToReinit = true
this.checkPermisisions() this.checkPermisisions()
} }
}) })