forked from forgejo/forgejo
Improve Stopwatch behavior (#18930)
- Don't send empty stopwatch over and over again, only send once. - Stop interval to update stopwatch's timer when there is no more stopwatch.
This commit is contained in:
parent
1ebb30e41b
commit
4e912a61c8
5 changed files with 77 additions and 33 deletions
|
@ -127,6 +127,10 @@ function updateStopwatchData(data) {
|
|||
const watch = data[0];
|
||||
const btnEl = $('.active-stopwatch-trigger');
|
||||
if (!watch) {
|
||||
if (updateTimeInterval) {
|
||||
clearInterval(updateTimeInterval);
|
||||
updateTimeInterval = null;
|
||||
}
|
||||
btnEl.addClass('hidden');
|
||||
} else {
|
||||
const {repo_owner_name, repo_name, issue_index, seconds} = watch;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue