mirror of
https://github.com/owncast/owncast.git
synced 2024-11-29 11:39:08 +03:00
Handle all server status changes
This commit is contained in:
parent
d2f65380a1
commit
c5f02a091b
1 changed files with 8 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue