Skip to content

Commit

Permalink
fix: trigger the first request even when the polling in not set, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Feb 27, 2024
1 parent f00b584 commit 335efe2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/hooks/useInterval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export function useInterval(callback: () => void, delay: number | null, deps: an

// Set up the interval.
useEffect(() => {
savedCallback.current();

// Don't schedule if no delay is specified.
if (delay === null) {
return;
}

savedCallback.current();
let isLastFinished = true;

const id = setInterval(async () => {
Expand Down

0 comments on commit 335efe2

Please sign in to comment.