Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix time tracking stopwatch lag
Prior to this, the stopwatch was lagging behind the real time and it was not possible to manually edit the time field. The lag was caused by the use of setTimeout to add to a counter each second. Browsers put inactive tabs to sleep for a few seconds, causing cumulative delays between each call to setTimeout. I have changed setTimeout to setInterval to better express the intention of calling a function in a loop and inside that function I have switched from a simple add to a counter, to calculate the diff in seconds between startTime and current time, using the moment.js library to help. Fixes #22919 Signed-off-by: Damien Regad <dregad@mantisbt.org>
- Loading branch information
Showing
1 changed file
with
43 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters