Improve forceDisconnected state change handling (#16271)

GitOrigin-RevId: 4c09c1ef8123ad84358d0446c1249e4a0ae7c217
This commit is contained in:
Alf Eaton 2023-12-15 12:21:34 +00:00 committed by Copybot
parent d0bbcca839
commit a4cfb8c01d

View file

@ -14,9 +14,14 @@ function ForceDisconnected() {
useEffect(() => { useEffect(() => {
if (connectionState.forceDisconnected) { if (connectionState.forceDisconnected) {
setShow(true) setShow(true)
}
}, [connectionState.forceDisconnected])
useEffect(() => {
if (connectionState.forceDisconnected) {
setSecondsUntilRefresh(connectionState.forcedDisconnectDelay) setSecondsUntilRefresh(connectionState.forcedDisconnectDelay)
} }
}, [connectionState]) }, [connectionState.forceDisconnected, connectionState.forcedDisconnectDelay])
useEffect(() => { useEffect(() => {
if (show) { if (show) {