aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-04-25 20:45:22 +0000
committerGitHub <noreply@github.com>2022-04-25 22:45:22 +0200
commit4e912a61c8083498427eba930a0a99eba91be0ed (patch)
tree94bf0d7fbcc990877cdb34541639a9a8642ab7d8 /web_src
parent1ebb30e41bf3b44404d7d03a5541729762c226b5 (diff)
downloadgitea-4e912a61c8083498427eba930a0a99eba91be0ed.tar.gz
gitea-4e912a61c8083498427eba930a0a99eba91be0ed.zip
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.
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/stopwatch.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/web_src/js/features/stopwatch.js b/web_src/js/features/stopwatch.js
index f86a801038..c47ba22124 100644
--- a/web_src/js/features/stopwatch.js
+++ b/web_src/js/features/stopwatch.js
@@ -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;