This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add home screen risk cell update button countdown #866
Add home screen risk cell update button countdown #866
Changes from 1 commit
0ff83ce
423e9cb
c5cf45f
edbbc97
2b48866
02c1cd6
846c911
a0ca72d
76d54cf
f725d17
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, the timer
invalidate
is only called in the CoutdownTimer class:My question is, if the app goes background, the Timer still runs? What will happened if the user opens the App after 2 days?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for bringing this up, I discovered a bug in my implementation where the timer was not stopped as I expected due to a reference cycle. I added a manual invalidate() method to make sure the timer is handled correctly.
Regarding the opening of the app after some time has passed: The timer is guaranteed to be up-to-date since the scene delegate will trigger the updateExposureState() method of the home VC when the app comes into foreground.
To make sure the timer does not drain the users battery when the app goes into background, I added a few lines that invalidate the handler when the app goes into background.