aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-31 06:40:00 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-31 06:40:00 +0800
commitb673a7a7fc66f1582ddb7cd94b32548a58a87670 (patch)
tree47fc885802bd14ad78da82f621723c32b31abe25
parent34617a21c30afcca54a5ac884e361d41d39a4699 (diff)
downloadtangerine-wallet-browser-b673a7a7fc66f1582ddb7cd94b32548a58a87670.tar
tangerine-wallet-browser-b673a7a7fc66f1582ddb7cd94b32548a58a87670.tar.gz
tangerine-wallet-browser-b673a7a7fc66f1582ddb7cd94b32548a58a87670.tar.bz2
tangerine-wallet-browser-b673a7a7fc66f1582ddb7cd94b32548a58a87670.tar.lz
tangerine-wallet-browser-b673a7a7fc66f1582ddb7cd94b32548a58a87670.tar.xz
tangerine-wallet-browser-b673a7a7fc66f1582ddb7cd94b32548a58a87670.tar.zst
tangerine-wallet-browser-b673a7a7fc66f1582ddb7cd94b32548a58a87670.zip
kill camera stream when unmouting
-rw-r--r--ui/app/components/modals/qr-scanner/qr-scanner.component.js5
1 files changed, 4 insertions, 1 deletions
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 998967776..580774635 100644
--- a/ui/app/components/modals/qr-scanner/qr-scanner.component.js
+++ b/ui/app/components/modals/qr-scanner/qr-scanner.component.js
@@ -33,6 +33,10 @@ export default class QrScanner extends Component {
}
}
+ componentWillUnmount () {
+ this.codeReader.reset()
+ }
+
initCamera () {
console.log('[QR-SCANNER]: initCamera')
this.codeReader = new BrowserQRCodeReader()
@@ -50,7 +54,6 @@ export default class QrScanner extends Component {
this.codeReader.decodeFromInputVideoDevice(videoInputDevices[0].deviceId, 'video')
.then(content => {
console.log('[QR-SCANNER]: initCamera::decodeFromInputVideoDevice callback', content)
- this.codeReader.reset()
const result = this.parseContent(content.text)
if (result.type !== 'unknown') {
this.props.qrCodeDetected(result)