1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 17:17:19 +00:00

only refresh when shown

This commit is contained in:
silverwind
2024-04-27 17:14:41 +02:00
parent 5f42448f3d
commit 5372c79416

View File

@ -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);