BitCannaGlobal / WeedMobile

5 stars 1 forks source link

Add option to select wallet lock time-out #20

Closed TJ-BitCanna closed 9 months ago

TJ-BitCanna commented 11 months ago

As specified in the UX flow a setting is desired for users to be able to decide themselves what timeframe would be applicable for their wallet to lock itself. That is now missing. 2023-10-13 13 06 57

atmoner commented 9 months ago

I have started integrating this option but I still have to think about how to best integrate it

image

Coded here: https://github.com/BitCannaGlobal/WeedMobile/commit/cfbe3601b30e0e5502482f5678431e78e73b9cb7

atmoner commented 9 months ago

To summarize, here is the current configuration: 1/ If the user opens the app for the first time, the default time is 1 minute (60 sec) 2/ If the user has already changed the default disconnection time, each time the app is opened, this value will be set by default.

image

image

image

Fixed here: https://github.com/BitCannaGlobal/WeedMobile/commit/38e15be1e29f4c3970d16de5da5baed4dfb368f2

TJ-BitCanna commented 9 months ago

Just tested setting from 1 minute to 5 minutes on Android. App is indeed not locked after 1 minute in the background. That works.

However, when the app is closed and restarted the value is reset to 1 minute again. It does not remember the preference set to 5 minutes.

atmoner commented 9 months ago

Ok! First debug result:

image https://capacitorjs.com/docs/apis/app

For app status change detection, I use 1 Except that this function only checks if the app is used or not

In addition to 1, I would have to use 2, this is exactly the solution for issue #20 This feature is more important than I thought!! And I had to read the doc to understand (RTFM, as usual)

Fix: https://capacitorjs.com/docs/apis/app#addlistenerapprestoredresult-

This is a personal note

atmoner commented 9 months ago

And finaly fixed!! Can be tested =)

TJ-BitCanna commented 9 months ago

Tested: over 5 minutes it nicely gives a time-out if the time has been set to 5. Returning after just 1 minute nicely gives an unlocked wallet.

Works!