Re-send camera states after websocket disconnects and reconnects

This commit is contained in:
Josh Hawkins 2024-11-07 08:06:17 -06:00
parent bc371acb3e
commit c2488525d3

View File

@ -69,7 +69,10 @@ function useValue(): useValueReturn {
...prevState,
...cameraStates,
}));
if (Object.keys(cameraStates).length > 0) {
setHasCameraState(true);
}
// we only want this to run initially when the config is loaded
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [wsState]);
@ -93,6 +96,9 @@ function useValue(): useValueReturn {
retain: false,
});
},
onClose: () => {
setHasCameraState(false);
},
shouldReconnect: () => true,
retryOnError: true,
});