Skip to content

Commit 1975b7a

Browse files
committed
stop interval when 0 otherwise resume
1 parent 25427fd commit 1975b7a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Frontend/src/components/audit/AuditList.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ function setQuery() {
7979
}
8080
8181
watch(autoRefreshValue, (newValue) => {
82-
updateInterval(newValue || 0);
8382
if (newValue === null || newValue === 0) {
8483
stop();
85-
} else if (!isActive.value) {
86-
start();
84+
} else {
85+
updateInterval(newValue);
86+
if (!isActive.value) {
87+
start();
88+
}
8789
}
8890
});
8991
</script>

src/Frontend/src/composables/autoRefresh.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ export default function useFetchWithAutoRefresh(name: string, fetch: () => Promi
6464
interval.value = newIntervalMs;
6565
console.debug(`[AutoRefresh] updated polling ${name} to ${newIntervalMs}ms`);
6666

67-
pause();
68-
if (isActive && newIntervalMs > 0) {
67+
if (isActive.value) {
68+
// We need to do this hack, because useTimeoutPoll doesn't react to interval changes while active
69+
pause();
6970
resume();
7071
}
7172
};

0 commit comments

Comments
 (0)