[FIX] Seconds not properly prevented from being negative #1310
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.
The current code ...
Authenticator/src/store/Accounts.ts
Line 90 in 6511920
... fails in these two examples:
The offset (middle value) can be as low as
-300
.Authenticator/src/syncTime.ts
Line 27 in 6511920
So the least you can have is
-241 (59 - 300)
, the+ 60
is not enough to make a positive number.Without this fix, in the examples given above, the effect will be:
Countdown circle animation may be out of sync with the current time step because
animationDelay
will be stuck at0s
.Authenticator/src/components/Popup/EntryComponent.vue
Lines 22 to 29 in 6511920
timeout
class will never activate unlessentry.period < 5
because the left side of the<
condition will be stuck atentry.period
.Authenticator/src/components/Popup/EntryComponent.vue
Line 59 in 6511920