Skip to content

feat(common): prevent useTimer.pause from storing negative remaining time - #903

Open
qsysvcore wants to merge 1 commit into
coinbase:masterfrom
qsysvcore:fix/use-timer-negative-remaining-time
Open

qsysvcore wants to merge 1 commit into
coinbase:masterfrom
qsysvcore:fix/use-timer-negative-remaining-time

Conversation

@qsysvcore

Copy link
Copy Markdown

Fix: useTimer.pause() stores a negative remaining time

Problem

pause() in packages/common/src/hooks/useTimer.ts decremented remainingTimeRef.current unconditionally, without clamping, and used startTimeRef.current even when no timer was running:

remainingTimeRef.current -= currentTime - startTimeRef.current;

@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/2
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2
CODEOWNERS 🟡 See below

🟡 CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 🟡 0/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants