eltcoin / eltwallet

Non-custodial decentralized mobile wallet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pincode is able to be pressed again across the screen width.

opened this issue · comments

Reproduce the issue as following steps:

  1. Press "Recover wallet" button.
  2. Enter pincode.
  3. repeat pincode.
  4. Press back button on Recover wallet screen.
  5. Press any key, it is able to press any key, and pin indicator is over the screen.
    What will be the expectable action at this case?
    I expected back button on recover wallet screen will take me the first screen.
    Thanks.

@Aurelyn10 Nice catch!

What we can do is overwrite the back button action on this screen to reset the navigation stack to the Home screen!

Adding something like this to screens/RecoverWallet/index.js should work:

export default class RecoverWallet extends Component {
  static navigationOptions = ({ navigation }) => {
    const resetAction = NavigationActions.reset({
      index: 0,
      actions: [NavigationActions.navigate({ routeName: 'Home' })],
    });

    return {
      headerLeft: (
        <HeaderBackButton onPress={() => navigation.dispatch(resetAction)} />
      ),
    };
  };
...
}

Feel free to test it locally and submit a PR if it works 🚀