zidoro / pomatez

Stay Focused. Take a Break.
https://zidoro.github.io/pomatez/
MIT License
3.86k stars 160 forks source link

timer slower in background in tauri version #608

Open Inori-Lover opened 4 months ago

Inori-Lover commented 4 months ago

Describe the bug when choose tauri version, after hidden the main window, the clock become much slower then real time.

To Reproduce

  1. start the tauri version pomatez
  2. mark the time, close to tray
  3. after about 10 minutes
  4. open the main, compare time

Expected behavior time go as fast as system clock

Desktop (please complete the following information):

Additional context similar issue: https://github.com/zidoro/pomatez/issues/67 seem related issue: https://github.com/tauri-apps/tauri/issues/5250

sekwah41 commented 4 months ago

I need to rework the timer code anyway to support a mobile version, Though currently the code has a timer triggering every 1 second. When the browser goes into the background it tends to slow the number of functions that can trigger in the background. I am assuming this is going above the 1 second hence slowing this down. I am not sure when I will have time to address this properly, though I can take a look at making it validate the time remaining based on a start time rather than time remaining.

Inori-Lover commented 4 months ago

@sekwah41 thanks for quick response! it sound like a good work

Inori-Lover commented 4 months ago

sorry for the wrong operate.

sekwah41 commented 1 month ago

Making this a high priority now as it majorly causes an issue for the reliability