Skip to content

Commit

Permalink
enable rescanning
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaptijn committed Sep 14, 2021
1 parent b36d2df commit 2832b65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion validator-frontend/screens/ScanScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ class ScanScreen extends React.Component {
async componentDidMount() {
const { status } = await BarCodeScanner.requestPermissionsAsync();
this.setState({ hasCameraPermission: status === 'granted' });
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({scanned:false});
});
}

componentWillUnmount() {
this._unsubscribe();
}

render() {
Expand All @@ -132,7 +139,6 @@ class ScanScreen extends React.Component {

handleBarCodeScanned = ({ type, data }) => {
this.setState({scanned:true})
console.log('qrdata: '+data)
this.props.navigation.navigate('Validating', {qrString: data})
}
}
Expand Down

0 comments on commit 2832b65

Please sign in to comment.