Skip to content

Commit 5ff1e64

Browse files
committed
inline the if, fix comments
1 parent 760bab5 commit 5ff1e64

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

web_src/js/features/stopwatch.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ export function initStopwatch() {
2525
$(this).parent().trigger('submit');
2626
});
2727

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.
2929
const currSeconds = $('.stopwatch-time').attr('data-seconds');
3030
if (currSeconds) {
3131
updateStopwatchTime(currSeconds);
3232
}
3333

3434
let usingPeriodicPoller = false;
35-
// poll the stopwatch status periodically
3635
const startPeriodicPoller = (timeout) => {
3736
if (timeout <= 0 || !Number.isFinite(timeout)) return;
3837
usingPeriodicPoller = true;
@@ -149,9 +148,8 @@ function clearStopwatchTimer() {
149148
}
150149
function updateStopwatchTime(seconds) {
151150
const secs = parseInt(seconds);
152-
if (!Number.isFinite(secs)) {
153-
return;
154-
}
151+
if (!Number.isFinite(secs)) return;
152+
155153
clearStopwatchTimer();
156154
const $stopwatch = $('.stopwatch-time');
157155
const start = Date.now();

0 commit comments

Comments
 (0)