Skip to content

Commit 45688bc

Browse files
committed
Swap to useTimeoutPoll given that it waits for the callback to be finished
1 parent 1c2ac7c commit 45688bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Frontend/src/composables/autoRefresh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { watch, ref, shallowReadonly, type WatchStopHandle } from "vue";
2-
import { useDocumentVisibility, useIntervalFn } from "@vueuse/core";
2+
import { useDocumentVisibility, useTimeoutPoll } from "@vueuse/core";
33

44
export default function createAutoRefresh(name: string, fetch: () => Promise<void>, intervalMs: number) {
55
let refCount = 0;
@@ -11,7 +11,7 @@ export default function createAutoRefresh(name: string, fetch: () => Promise<voi
1111
await fetch();
1212
isRefreshing.value = false;
1313
};
14-
const { pause, resume } = useIntervalFn(
14+
const { pause, resume } = useTimeoutPoll(
1515
fetchWrapper,
1616
interval,
1717
{ immediate: false, immediateCallback: true } // we control first fetch manually

0 commit comments

Comments
 (0)