openwallet-foundation / bifold-wallet

Aries Mobile Agent React Native - Part of the Aries Bifold effort to provide SSI capabilities in a production ready app.
Apache License 2.0
154 stars 150 forks source link

feat: added new inactivity wrapper component #1283

Closed al-rosenthal closed 1 month ago

al-rosenthal commented 1 month ago

Summary of Changes

Created a new component: InactivityWrapper.tsx. This component is intended to wrap the app view to track user interactions (clicks, swipes, ect.). When an interaction is detected a timer internal to the component resets, if no interactions in a set time are made while the app is open, the user is logged out and is sent back to the pin entry screen.

Related Issues

bc-wallet-mobile: 2136

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.

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 🤓

PR template adapted from the Python attrs project.

bryce-mcmath commented 1 month ago

I wonder if it's worth consolidating some of the very similar code in the RootStack into this component, so both types of lockout are handled from the same place. @jleach thoughts?

bryce-mcmath commented 1 month ago

Will also need to add this wrapper to the Bifold example app (so either in RootStack.tsx or in something like packages/legacy/app/App.tsx depending on how you implement it)

al-rosenthal commented 1 month ago

Will also need to add this wrapper to the Bifold example app (so either in RootStack.tsx or in something like packages/legacy/app/App.tsx depending on how you implement it)

I've added the wrapper to the App.tsx

jleach commented 1 month ago

@al-rosenthal You can use yarn run lint in bifold and yarn run typecheck:core to cache code quality issues quicker or use husky on push.

al-rosenthal commented 1 month ago

This looks great but you may want to check with Kim / Clecio if an actual settings option (where the user can switch between the different lockout times) was part of the ticket.

A new settings page has been added to configure the timeout

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
1.2% Duplication on New Code

See analysis details on SonarCloud