Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep navigation state when resuming from background and login is required #2122

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

myxmaster
Copy link
Contributor

Description

This fixes #1880.

In Lockscreen, after successful login, we navigated to Wallet. Also, when going to background, we called navigation.pop() to close a possibly open PIN screen. Both caused that the navigation state was lost.

Instead we now call navigation.pop() after successful login in Lockscreen and clear the entered pin in PinPad when going to background.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Configuration change
  • Locales update
  • Quality assurance
  • Other

Checklist

  • I’ve run yarn run tsc and made sure my code compiles correctly
  • I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
  • I’ve run yarn run prettier and made sure my code is formatted correctly
  • I’ve run yarn run test and made sure all of the tests pass

Testing

If you modified or added a utility file, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • Android
  • iOS

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

  • Embedded LND
  • LND (REST)
  • LND (Lightning Node Connect)
  • Core Lightning (c-lightning-REST)
  • LndHub
  • [DEPRECATED] Core Lightning (Spark)
  • [DEPRECATED] Eclair

Locales

  • I’ve added new locale text that requires translations
  • I’m aware that new translations should be made on the ZEUS Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • Contributors will need to run yarn after this PR is merged in
  • 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • Changes were made that require an update to the README
  • Changes were made that require an update to onboarding

@kaloudis kaloudis added this to the v0.9.0 milestone Apr 12, 2024
// In case the lock screen is visible and a valid PIN is entered and home button is pressed,
// unauthorized access would be possible because the PIN is not cleared on next launch.
// By calling pop, the lock screen is closed to clear the PIN.
this.props.navigation.pop();
Copy link
Contributor

@shubhamkmr04 shubhamkmr04 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the issue but now we are having the issue as described in the comments here, we can come back to the zeus after typing in the correct passphrase and it will still be there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test and see that behaviour?
I am asking because that should definitely not happen (and I couldn't see that behaviour on Android emulator) because we are clearing the PIN: 8fc49c6#diff-8ba14cc97d1ffca67c674c4b343e6d0b0e8acbccc783040df6bdcc9db2186602R43

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's happening with passphrases in both android and iOS emulator

Screen.Recording.2024-04-15.at.7.35.11.PM.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah of course, you are right. Passphrase is not cleared, only PIN... So we need to take care of Passphrase too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also fixed the conflicts.
Additionally now navigating directly to intro splash when nodes are removed (duress pin/passphrase entered or too many failed login attempts).

Copy link
Contributor

@shubhamkmr04 shubhamkmr04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaloudis kaloudis modified the milestones: v0.9.0, v0.8.4 Apr 19, 2024
@kaloudis kaloudis merged commit 4f719d4 into ZeusLN:master Apr 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding photo to contact not possible with setting "Require login after app returns from background"
3 participants