mirror of
https://github.com/owncast/owncast.git
synced 2024-11-29 19:49:31 +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,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) {
|
||||||
|
|
Loading…
Reference in a new issue