add 6s timeout (#645)

Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net>
This commit is contained in:
Vikhyath Mondreti
2025-07-09 11:53:43 -07:00
committed by GitHub
parent 4a26b061a4
commit 24e19a83a5

View File

@@ -87,8 +87,10 @@ export function WorkspacePermissionsProvider({ children }: WorkspacePermissionsP
}
// If we were previously connected and this is a reconnection, stay offline (user must refresh)
} else if (hasBeenConnected) {
// Only enter offline mode if we were previously connected and now disconnected
setIsOfflineMode(true)
const timeoutId = setTimeout(() => {
setIsOfflineMode(true)
}, 6000)
return () => clearTimeout(timeoutId)
}
// If not connected and never been connected, stay in initial state (not offline mode)
}, [isConnected, hasBeenConnected])