fixup! wip to be discuss

This commit is contained in:
lebaudantoine
2026-09-04 22:44:43 +02:00
parent 38a40f12c5
commit e546d73834
2 changed files with 6 additions and 2 deletions
@@ -34,7 +34,9 @@ export const LobbyProvider = () => {
refetchOnReconnect: false,
refetchInterval: (query) => {
if (!query.state.data?.participants?.length) return false
if (isParticipantsOpen) return POLL_INTERVAL_MS
if (isParticipantsOpen) return (
query.state.error ? POLL_INTERVAL_MS * 3 : POLL_INTERVAL_MS
)
return LAZY_POLL_INTERVAL_MS
},
refetchIntervalInBackground: false,
@@ -53,7 +53,9 @@ export const useLobby = ({
}
return response
},
refetchInterval: POLL_INTERVAL_MS,
retry: false,
refetchInterval: (query) =>
query.state.error ? POLL_INTERVAL_MS * 3 : POLL_INTERVAL_MS,
refetchOnWindowFocus: false,
refetchIntervalInBackground: true,
enabled: status === ApiLobbyStatus.WAITING,