Handle all server status changes
This commit is contained in:
@@ -347,15 +347,17 @@ export const ClientConfigStore: FC = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hasLoadedStatus && hasLoadedConfig) {
|
if (hasLoadedStatus && hasLoadedConfig) {
|
||||||
sendEvent(AppStateEvent.Loaded);
|
sendEvent(AppStateEvent.Loaded);
|
||||||
|
|
||||||
if (serverStatus.online) {
|
|
||||||
sendEvent(AppStateEvent.Online);
|
|
||||||
} else {
|
|
||||||
sendEvent(AppStateEvent.Offline);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, [hasLoadedStatus, hasLoadedConfig]);
|
}, [hasLoadedStatus, hasLoadedConfig]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (serverStatus.online) {
|
||||||
|
sendEvent(AppStateEvent.Online);
|
||||||
|
} else {
|
||||||
|
sendEvent(AppStateEvent.Offline);
|
||||||
|
}
|
||||||
|
}, [serverStatus]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!clientConfig.chatDisabled && accessToken && hasLoadedConfig) {
|
if (!clientConfig.chatDisabled && accessToken && hasLoadedConfig) {
|
||||||
startChat();
|
startChat();
|
||||||
|
|||||||
Reference in New Issue
Block a user