state.js: do not connect unless a state subclass is defined (#2259)

This commit is contained in:
Masen Furer 2023-12-05 17:14:47 -08:00 committed by GitHub
parent 77405d1701
commit 21000d9889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -549,7 +549,7 @@ export const useEventLoop = (
return;
}
// only use websockets if state is present
if (Object.keys(initialState).length > 0) {
if (Object.keys(initialState).length > 1) {
// Initialize the websocket connection.
if (!socket.current) {
connect(socket, dispatch, ['websocket', 'polling'], setConnectError, client_storage)