Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Handle all server status changes

Gabe Kangasac5a04e9ce9e
diff --git a/web/components/stores/ClientConfigStore.tsx b/web/components/stores/ClientConfigStore.tsx
index 677f3d111b..18dfa7bcf3 100644
--- a/web/components/stores/ClientConfigStore.tsx
+++ b/web/components/stores/ClientConfigStore.tsx
@@ -347,15 +347,17 @@ export const ClientConfigStore: FC = () => {
useEffect(() => {
if (hasLoadedStatus && hasLoadedConfig) {
sendEvent(AppStateEvent.Loaded);
-
- if (serverStatus.online) {
- sendEvent(AppStateEvent.Online);
- } else {
- sendEvent(AppStateEvent.Offline);
- }
}
}, [hasLoadedStatus, hasLoadedConfig]);
+ useEffect(() => {
+ if (serverStatus.online) {
+ sendEvent(AppStateEvent.Online);
+ } else {
+ sendEvent(AppStateEvent.Offline);
+ }
+ }, [serverStatus]);
+
useEffect(() => {
if (!clientConfig.chatDisabled && accessToken && hasLoadedConfig) {
startChat();