Updated QR Code scan call

This commit is contained in:
Marcos Rodriguez Vélez 2018-09-18 02:51:44 -04:00 committed by Igor Korsakov
parent 6637d2d380
commit 712228bd06

View File

@ -24,14 +24,14 @@ export default class ScanQrWif extends React.Component {
type: Camera.Constants.Type.back,
};
async onBarCodeRead(ret) {
async onBarCodeScanned(ret) {
if (+new Date() - this.lastTimeIveBeenHere < 3000) {
this.lastTimeIveBeenHere = +new Date();
return;
}
this.lastTimeIveBeenHere = +new Date();
console.log('onBarCodeRead', ret);
console.log('onBarCodeScanned', ret);
if (ret.data[0] === '6') {
// password-encrypted, need to ask for password and decrypt
console.log('trying to decrypt...');
@ -170,7 +170,7 @@ export default class ScanQrWif extends React.Component {
);
} else {
return (
<Camera style={{ flex: 1 }} type={this.state.type} onBarCodeRead={ret => this.onBarCodeRead(ret)}>
<Camera style={{ flex: 1 }} type={this.state.type} onBarCodeScanned={ret => this.onBarCodeScanned(ret)}>
<View
style={{
flex: 1,