Comments (18)
I think this is still an issue.
I just had a 5 minute timer go off. Full screen.
I closed the lid.
10 minutes passed
I opened the lid, and the timer was still at 4 minutes.
from pomatez.
Describe the bug
Timer stops working when computer goes to sleep.
To Reproduce
- Start timer.
- Close computer lid
- Wait 2 minutes
- Open lid and wait for computer to wake up
- Observe timer had not subtracted 2 minutes, and it is currently stopped (not counting).
Expected behavior
Timer continues counting after re-opening of the computer.
Screenshots
N/A
Desktop (please complete the following information):
- OS: macOS Catalina
- Version: 10.15.4 (19E287)
Additional context
This feature is mostly important for break timers. When I am on a 15 minute break, the computer may fall asleep.
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.
from pomatez.
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.
from pomatez.
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?
from pomatez.
I have tried the PowerSaveBlocker
of Electron preventing the Operating System from entering sleep mode before but it didn't work on my Laptop.
from pomatez.
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.
from pomatez.
Then probably want an event like resume
when it comes back from sleep to fire of the timers in the UI again:
https://www.electronjs.org/docs/api/power-monitor
from pomatez.
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.
Does it prevent the Operating System from asleep?
from pomatez.
Then probably want an event like
resume
when it comes back from sleep to fire of the timers in the UI again:
I've also tried it before and it didn't work. I will try it again combining powerMonitor
and PowerSaveBlocker
with the latest Electron release.
from pomatez.
Does it prevent the Operating System from asleep?
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.
from pomatez.
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.
from pomatez.
Hi @moltar . I just released new version of the app.
Please visit v2.10.0-beta Release Note.
Also, let me know if the bug you've encountered fixed by this latest version of the app. Have a great day!
from pomatez.
Ok, thanks. Upgraded, will try next week.
from pomatez.
Got the following immediately after launching the upgraded version:
And I can't quit the app now.
from pomatez.
The window is squished:
from pomatez.
@moltar just go to Settings
and just press Restore Default
.
It might happened due to old settings are not compatible with the new features.
Please let me know the results.
from pomatez.
just go to Settings and just press Restore Default.
That did fix it, thanks.
from pomatez.
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.
from pomatez.
Related Issues (20)
- Bug Report: Can drag navbar links HOT 2
- chore: update pr actions to flag when commits and/or pr title does not match conventional commits
- UX opinion (scrollbar too tiny) HOT 1
- Bug Report: Compact mode layout broke with 120 minutes max timer config HOT 6
- Interfering with other software hotkeys HOT 1
- On timmer resume, notify user the total amount of time for which he had paused the timmer. HOT 2
- Can you extend the studying session's length, please? HOT 3
- Feedback form on uninstallation HOT 4
- a report
- Bug Report: Flash of the tray icon every second HOT 2
- Replace the Windows proprietary sound with something else HOT 4
- Use custom sound files HOT 1
- Bug Report: When configuration (time) is updated via keyboard it's not applied
- Shortcuts edit and enable/disable feature HOT 1
- Fix Misleading Readme Quick Setup Instruction
- Fix Vulnerability Issues HOT 1
- Bug Report: 1.3.0 Javascript error HOT 10
- Native Voices
- Add pomatez to Flathub HOT 6
- Disable Auto Open Github Repo Everytime machine starts HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pomatez.