mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
Merge pull request #35569 from overleaf/mj-network-stalled-on-disconnect
[web] Check websocket status in stall test GitOrigin-RevId: c62f2d3641d444d8bbe2eed84a6ed6a0ad241b2a
This commit is contained in:
committed by
Copybot
parent
bbe1c2126a
commit
b526135232
@@ -1,10 +1,14 @@
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
import { useUnsavedDocsContext } from '@/features/ide-react/context/unsaved-docs-context'
|
||||
import { useIdeReactContext } from '@/features/ide-react/context/ide-react-context'
|
||||
import { useConnectionContext } from '../context/connection-context'
|
||||
|
||||
export default function useIsNetworkStalled(): boolean {
|
||||
const enabled = useFeatureFlag('intermittent-connection-improvements')
|
||||
const { isSavingStalled } = useUnsavedDocsContext()
|
||||
const { outOfSync } = useIdeReactContext()
|
||||
return enabled && (isSavingStalled || outOfSync)
|
||||
const { isConnected, connectionState } = useConnectionContext()
|
||||
const websocketDisconnected =
|
||||
!isConnected || connectionState.reconnectAt !== null
|
||||
return enabled && (isSavingStalled || outOfSync || websocketDisconnected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user