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

fix: double pin screen #1121

Merged

Conversation

wadeking98
Copy link
Contributor

@wadeking98 wadeking98 commented Mar 25, 2024

Summary of Changes

  • Added fix to stop PIN screen from appearing twice.
  • Moved async storage calls to dependency injection called once in rootstack
  • Promisified async storage calls to run in parallel, seeping up app startup
fixSplashStartup.mov

Related Issues

N/A

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this);
  • Updated LICENSE-3RD-PARTY.md for any added dependencies or vendored components;
  • Updated documentation as needed for changed code and new or modified features;
  • Added sufficient tests so that overall code coverage is not reduced.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated tests have passed.

PR template adapted from the Python attrs project.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 10.25641% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 62.02%. Comparing base (0a4903c) to head (a1fc59d).

Files Patch % Lines
packages/legacy/core/App/container-impl.ts 4.76% 20 Missing ⚠️
packages/legacy/core/App/screens/Splash.tsx 33.33% 6 Missing ⚠️
...ackages/legacy/core/App/contexts/reducers/store.ts 0.00% 5 Missing ⚠️
packages/legacy/core/App/navigators/RootStack.tsx 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1121      +/-   ##
==========================================
- Coverage   62.09%   62.02%   -0.08%     
==========================================
  Files         178      178              
  Lines        5733     5738       +5     
  Branches     1655     1654       -1     
==========================================
- Hits         3560     3559       -1     
- Misses       2150     2156       +6     
  Partials       23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bryce-mcmath bryce-mcmath changed the title Fix double pin screen fix double pin screen Mar 25, 2024
@bryce-mcmath bryce-mcmath changed the title fix double pin screen fix: double pin screen Mar 25, 2024
loginAttempt = data
}
}),
loadState<PreferencesState>(LocalStorageKeys.Preferences, (val) => (preferences = val)),
Copy link
Contributor Author

@wadeking98 wadeking98 Mar 25, 2024

Choose a reason for hiding this comment

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

I had to use the (val) => (thing = val) pattern here because I needed to mutate the thing variable inside the generic function but I couldn't use useRef or useState because react would complain about hooks being used in the wrong place. There's probably a better way to do this, feel free to mention it if you think of a better alternative

Signed-off-by: wadeking98 <[email protected]>
Copy link
Contributor

@bryce-mcmath bryce-mcmath left a comment

Choose a reason for hiding this comment

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

Just one small thing, otherwise I think this is a great change

packages/legacy/core/App/navigators/RootStack.tsx Outdated Show resolved Hide resolved
@wadeking98 wadeking98 merged commit 3b63696 into openwallet-foundation:main Mar 26, 2024
5 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.

3 participants