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

Custom auto lock #3471

Closed
Shadowfiend opened this issue Jun 12, 2023 · 1 comment · Fixed by #3477
Closed

Custom auto lock #3471

Shadowfiend opened this issue Jun 12, 2023 · 1 comment · Fixed by #3477
Assignees

Comments

@Shadowfiend
Copy link
Contributor

https://www.figma.com/file/q8gfu9XTbYBF07KMnDCtsD/UI---Dark?type=design&node-id=19917-393091&t=fyoGFeYaBK5ATloJ-4

This config value will replace the constants MAX_KEYRING_IDLE_TIME and MAX_OUTSIDE_IDLE_TIME:

export const MAX_KEYRING_IDLE_TIME = 60 * MINUTE
export const MAX_OUTSIDE_IDLE_TIME = 60 * MINUTE

For now, the two should end up with the same value.

It would make sense for KeyringService to gain a dependency on PreferencesService and update its internal lock time based on configuration adjustments via event emissions. When that setting is updated, it would probably also make sense to call autolockIfNeeded, so that if the user drops the max idle time to an amount that is < the current idle time, the keyring locks immediately.

@hyphenized hyphenized self-assigned this Jun 13, 2023
jagodarybacka added a commit that referenced this issue Jun 23, 2023
Closes #3471

Adds a dropdown on settings to allow changing the maximum amount of time
the wallet can remain idle before locking signing. This new setting is
updated through an async thunk which triggers an event to also handle
the change on the keyring service. The data is persisted on preferences
db and exposed through redux to the UI.

## Testing Env

```
SUPPORT_CUSTOM_AUTOLOCK=true
```

## To Test
- [x] Import an account
- [x] Lock and unlock your wallet
- [x] Head to settings, change auto-lock time
- [x] Change your system's date or change the options
[here](https://github.com/tahowallet/extension/blob/be6fae78bd7949cd5e4d8f37c882152d00e8141d/ui/pages/Settings.tsx#L308),
test that different time options work correctly
- [x] If the wallet has been idle for 10 minutes and the current auto
lock setting changes to from 15 minutes to 5, the wallet should lock
itself.

Latest build:
[extension-builds-3477](https://github.com/tahowallet/extension/suites/13795656037/artifacts/764974743)
(as of Thu, 22 Jun 2023 16:11:15 GMT).
@jagodarybacka
Copy link
Contributor

Already merged to the feature branch

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 a pull request may close this issue.

3 participants