socket connect/disconnect depends on new isBackendDisabled state
This commit is contained in:
parent
0edb6b9be8
commit
38d2ef721d
@ -819,7 +819,7 @@ export const useEventLoop = (
|
|||||||
|
|
||||||
// Handle socket connect/disconnect.
|
// Handle socket connect/disconnect.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// only use websockets if state is present
|
// only use websockets if state is present and backend is not disabled (reflex cloud).
|
||||||
if (Object.keys(initialState).length > 1 && !isBackendDisabled()) {
|
if (Object.keys(initialState).length > 1 && !isBackendDisabled()) {
|
||||||
// Initialize the websocket connection.
|
// Initialize the websocket connection.
|
||||||
if (!socket.current) {
|
if (!socket.current) {
|
||||||
@ -839,7 +839,7 @@ export const useEventLoop = (
|
|||||||
socket.current.disconnect();
|
socket.current.disconnect();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, []);
|
}, [isBackendDisabled]);
|
||||||
|
|
||||||
// Main event loop.
|
// Main event loop.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user