From 94a89790dcca3003fde59e8385b8c3d32f36d466 Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Tue, 31 Jul 2018 18:58:54 -0400 Subject: [PATCH] fix --- .../components/modals/qr-scanner/qr-scanner.component.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/app/components/modals/qr-scanner/qr-scanner.component.js b/ui/app/components/modals/qr-scanner/qr-scanner.component.js index d8091ecee..e6ba146d6 100644 --- a/ui/app/components/modals/qr-scanner/qr-scanner.component.js +++ b/ui/app/components/modals/qr-scanner/qr-scanner.component.js @@ -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() } })