Handle all server status changes

This commit is contained in:
Gabe Kangas 2022-11-13 14:50:20 -08:00
parent d2f65380a1
commit c5f02a091b
No known key found for this signature in database
GPG key ID: 9A56337728BC81EA

View file

@ -347,14 +347,16 @@ export const ClientConfigStore: FC = () => {
useEffect(() => { useEffect(() => {
if (hasLoadedStatus && hasLoadedConfig) { if (hasLoadedStatus && hasLoadedConfig) {
sendEvent(AppStateEvent.Loaded); sendEvent(AppStateEvent.Loaded);
}
}, [hasLoadedStatus, hasLoadedConfig]);
useEffect(() => {
if (serverStatus.online) { if (serverStatus.online) {
sendEvent(AppStateEvent.Online); sendEvent(AppStateEvent.Online);
} else { } else {
sendEvent(AppStateEvent.Offline); sendEvent(AppStateEvent.Offline);
} }
} }, [serverStatus]);
}, [hasLoadedStatus, hasLoadedConfig]);
useEffect(() => { useEffect(() => {
if (!clientConfig.chatDisabled && accessToken && hasLoadedConfig) { if (!clientConfig.chatDisabled && accessToken && hasLoadedConfig) {