File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,13 @@ export function initStopwatch() {
25
25
$ ( this ) . parent ( ) . trigger ( 'submit' ) ;
26
26
} ) ;
27
27
28
- // global stop watch (in the head_navbar), it should always work in any case either the EventSource or the TimerPoller is used.
28
+ // global stop watch (in the head_navbar), it should always work in any case either the EventSource or the PeriodicPoller is used.
29
29
const currSeconds = $ ( '.stopwatch-time' ) . attr ( 'data-seconds' ) ;
30
30
if ( currSeconds ) {
31
31
updateStopwatchTime ( currSeconds ) ;
32
32
}
33
33
34
34
let usingPeriodicPoller = false ;
35
- // poll the stopwatch status periodically
36
35
const startPeriodicPoller = ( timeout ) => {
37
36
if ( timeout <= 0 || ! Number . isFinite ( timeout ) ) return ;
38
37
usingPeriodicPoller = true ;
@@ -149,9 +148,8 @@ function clearStopwatchTimer() {
149
148
}
150
149
function updateStopwatchTime ( seconds ) {
151
150
const secs = parseInt ( seconds ) ;
152
- if ( ! Number . isFinite ( secs ) ) {
153
- return ;
154
- }
151
+ if ( ! Number . isFinite ( secs ) ) return ;
152
+
155
153
clearStopwatchTimer ( ) ;
156
154
const $stopwatch = $ ( '.stopwatch-time' ) ;
157
155
const start = Date . now ( ) ;
You can’t perform that action at this time.
0 commit comments