-
Notifications
You must be signed in to change notification settings - Fork 168
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
Bug Report: Timer stops when computer goes to sleep #84
Comments
I've also encountered that and I have no idea how to prevent Operating System to not fall asleep while timer still running. Anyway thanks for informing me. I will try to fix that ASAP on my next release. |
I think the solution would be not to store the remaining seconds, but rather store the start date, and then calculate the remaining time based on that. |
I'm not that good enough to comprehend what do you mean by that. If possible can you provide some good example on how to do that? |
I have tried the |
I am not sure how the app works. But I am assuming there is a sort of thing: let remainingSeconds = 100
setInterval(() => remainingSeconds = remainingSeconds - 1, 1000) But instead, should be something like: const timeStartDate = new Date()
const timerDurationMs = 15 * 60 * 1000
let remainingTime = 0
setInterval(() => {
remainingTime = timerDurationMs - (new Date().getTime() - timeStartDate.getTime())
}), 1000) That way, the hard date is saved, and it can always be referenced again. But maybe this is already how it works, I am not sure. |
Then probably want an event like |
Does it prevent the Operating System from asleep? |
I've also tried it before and it didn't work. I will try it again combining |
Not, but it will re-start from the right time if it wakes up at least. Otherwise the time is frozen at the time when the system went to sleep. |
I'm working with the new features of the app right now and will try to fix some bugs including the issue you've posted. I really appreciate your suggestion and will try it if my solutions didn't fix the issue at least. |
Hi @moltar . I just released new version of the app. Please visit v2.10.0-beta Release Note. |
Ok, thanks. Upgraded, will try next week. |
@moltar just go to It might happened due to old settings are not compatible with the new features. Please let me know the results. |
That did fix it, thanks. |
I think this is still an issue. I just had a 5 minute timer go off. Full screen. |
I'm sorry @moltar but I think it is not an issue. Just don't closed the lid or manually sleep the computer because the app doesn't have the full control to prevent you from making your computer off / sleep. The only concern here is that the app will prevent your computer from automatically sleeping while your computer is on idle especially when full-screen persisted and preventing you from working. If you really want to take that break. I suggest just don't close the lid. Just wait for the break to finished. |
Describe the bug
Timer stops working when computer goes to sleep.
To Reproduce
Expected behavior
Timer continues counting after re-opening of the computer.
Screenshots
N/A
Desktop (please complete the following information):
Additional context
This feature is mostly important for break timers. When I am on a 15 minute break, the computer may fall asleep.
The text was updated successfully, but these errors were encountered: