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

Pomodoro Timer #608

Closed
SergioTEC opened this issue Nov 27, 2023 · 1 comment
Closed

Pomodoro Timer #608

SergioTEC opened this issue Nov 27, 2023 · 1 comment
Labels
bug Something isn't working good first issue

Comments

@SergioTEC
Copy link

SergioTEC commented Nov 27, 2023

Describe the bug

When you pause the Pomodoro timer after a short time, the sounds start playing on their own again.
To reproduce the error just pause the timer and wait a few seconds.

Environment

Browser: Chrome Versão 119.0.6045.160 (Versão oficial) 64 bits
OS: Windows 11 22H2 22621.1848
Node Version: v16.13.0

Screenshot

No response

Output

No response

@SergioTEC SergioTEC added the bug Something isn't working label Nov 27, 2023
@mateusfg7 mateusfg7 added ux/ui Interface and style changes good first issue and removed ux/ui Interface and style changes labels Dec 1, 2023
@mateusfg7
Copy link
Owner

I've been investigating this bug, and looks like it is related with this piece of code:

useEffect(() => {
const soundState = getSoundState(sound.id)
if (!soundState || !localSoundState) return
if (userHasInteracted) {
sync.active(soundState)
sync.volume(soundState)
}
setLocalSoundState(soundState)
mountQueryParams()
}, [soundsStore, userHasInteracted])
and the reference equality behavior of useEffect.

The solution I was found is to use useDeepCompareEffect from "react-use" library. As mentioned in this discussion: https://stackoverflow.com/questions/57859484/useeffect-runs-infinite-loop-despite-no-change-in-dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue
Projects
None yet
Development

No branches or pull requests

2 participants