diff options
author | Norwin <noerw@users.noreply.github.com> | 2021-02-19 23:06:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-20 00:06:56 +0100 |
commit | 91424fff3def09970c71c5725643daa4c5b141de (patch) | |
tree | 86632dac4bf8f99cffaec8c0b533deae5c1e7d07 /web_src/js/features/stopwatch.js | |
parent | aa4f9180e4932a9813e898bf3bd9ac91924eeb03 (diff) | |
download | gitea-91424fff3def09970c71c5725643daa4c5b141de.tar.gz gitea-91424fff3def09970c71c5725643daa4c5b141de.zip |
stopwatch notif: check if timetracking is enabled (#14750)
fixes #14435
Diffstat (limited to 'web_src/js/features/stopwatch.js')
-rw-r--r-- | web_src/js/features/stopwatch.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/web_src/js/features/stopwatch.js b/web_src/js/features/stopwatch.js index 433f042a1f..61f19bd795 100644 --- a/web_src/js/features/stopwatch.js +++ b/web_src/js/features/stopwatch.js @@ -1,11 +1,14 @@ import prettyMilliseconds from 'pretty-ms'; -const {AppSubUrl, csrf, NotificationSettings} = window.config; +const {AppSubUrl, csrf, NotificationSettings, EnableTimetracking} = window.config; let updateTimeInterval = null; // holds setInterval id when active export async function initStopwatch() { - const stopwatchEl = $('.active-stopwatch-trigger'); + if (!EnableTimetracking) { + return; + } + const stopwatchEl = $('.active-stopwatch-trigger'); stopwatchEl.removeAttr('href'); // intended for noscript mode only stopwatchEl.popup({ position: 'bottom right', |