Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/connect-status-hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ export const useConnectStatusUpdater = (
useState<boolean>(true);

useEffect(() => {
if (!isBrowserTabVisible && currConnType === "radio") {
// Show reconnecting when user hides browser tab for radio bridge connection
if (
!isBrowserTabVisible &&
currConnType === "radio" &&
connectionStatus === ConnectionStatus.Connected
) {
// Show reconnecting when user hides browser tab and is radio connected
setConnectionStatus(ConnectionStatus.ReconnectingAutomatically);
return;
}
Expand All @@ -131,7 +135,7 @@ export const useConnectStatusUpdater = (
setOnFirstConnectAttempt,
});
prevDeviceStatus.current = deviceStatus;
if (nextState) {
if (nextState && isBrowserTabVisible) {
handleStatus && handleStatus(nextState.status, nextState.flowType);
setConnectionStatus(nextState.status);
}
Expand Down
Loading