Skip to content

Commit

Permalink
Fix endless loop
Browse files Browse the repository at this point in the history
  • Loading branch information
romeovs committed Nov 13, 2024
1 parent 6836dae commit 5343da7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/lib/live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,16 @@ export function useLiveInfo(options: Options): InfoState {
}

if (soonest < 0) {
load()
if (!state.data && !state.loading) {
load()
}
return
}

const t = setTimeout(load, soonest)
return () => clearTimeout(t)
},
[load, state.data, options.skip],
[load, state.data, state.loading, options.skip],
)

return {
Expand Down

0 comments on commit 5343da7

Please sign in to comment.