From c5f02a091b688c9ddd0e2a717ace8f8abaf5ba43 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sun, 13 Nov 2022 14:50:20 -0800 Subject: [PATCH] Handle all server status changes --- web/components/stores/ClientConfigStore.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/components/stores/ClientConfigStore.tsx b/web/components/stores/ClientConfigStore.tsx index 677f3d111..18dfa7bcf 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();