From 5372c79416c97366ed0c739f150d3d3ae9d7e8bb Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 27 Apr 2024 17:14:41 +0200 Subject: [PATCH] only refresh when shown --- web_src/js/features/stopwatch.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/stopwatch.js b/web_src/js/features/stopwatch.js index fa357b67b8..df321f8b21 100644 --- a/web_src/js/features/stopwatch.js +++ b/web_src/js/features/stopwatch.js @@ -165,8 +165,10 @@ function updateStopwatchTime(seconds) { const dur = prettyMilliseconds(secs * 1000 + delta, {compact: true}); if (stopwatch) stopwatch.textContent = dur; // refresh the tippy so that the triangle updates to the correct position - stopwatchTippy.hide(); - stopwatchTippy.show(); + if (stopwatchTippy.state.isShown) { + stopwatchTippy.hide(); + stopwatchTippy.show(); + } }; updateUi(); updateTimeIntervalId = setInterval(updateUi, 1000);