From e546d738340d5c3043f3cb53aabb8e6ab0f66159 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 4 Sep 2026 22:44:43 +0200 Subject: [PATCH] fixup! wip to be discuss --- src/frontend/src/features/rooms/components/LobbyProvider.tsx | 4 +++- src/frontend/src/features/rooms/hooks/useLobby.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/features/rooms/components/LobbyProvider.tsx b/src/frontend/src/features/rooms/components/LobbyProvider.tsx index b4e97eea..953adc60 100644 --- a/src/frontend/src/features/rooms/components/LobbyProvider.tsx +++ b/src/frontend/src/features/rooms/components/LobbyProvider.tsx @@ -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, diff --git a/src/frontend/src/features/rooms/hooks/useLobby.ts b/src/frontend/src/features/rooms/hooks/useLobby.ts index 3e5f14bc..e839b39f 100644 --- a/src/frontend/src/features/rooms/hooks/useLobby.ts +++ b/src/frontend/src/features/rooms/hooks/useLobby.ts @@ -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,