-
Notifications
You must be signed in to change notification settings - Fork 25
Description
In some situations the iOS app identifies that the user is trying to scan a QR Code for sending a transaction, when it's actually looking at the Dashboard. This may be related to recent upgrades to the React Navigation ( #688 ) that may try to pre-render the QR Code screen and ends up activating the QR Reader.
There is already a component effect dedicated to identifying if the QR component should be rendered or not, but it seems to be obsolete as of now.
hathor-wallet-mobile/src/components/QRCodeReader.js
Lines 33 to 40 in 3e301c9
| useEffect(() => { | |
| /* | |
| * We need to focus/unfocus the QRCode scanner, so that it doesn't freeze | |
| * - When the navigation focuses this screen or app becomes active, we set it to `true` | |
| * - When the navigation moves away or app becomes inactive, we set it to `false` | |
| */ | |
| let appStateEvent; | |
| const focusEvent = navigation.addListener('focus', () => { |
Probably this just needs to be adapted.
Steps to reproduce the error
- Load a wallet
- Send a transaction of
0.01 HTRusing a QR Code - When the "Success" modal is being shown, point the camera to the QR Code again
- Dismiss the modal
Expected behavior: the dashboard screen should be displayed and no action taken
Current behavior: while the dashboard screen is being displayed, the QR Code is read again, and the app navigates to the "Send Tokens" screen with no user input.