mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Explicitly set state for config+status when hydrated
This commit is contained in:
parent
e49b61e13b
commit
952b28f8bf
@ -331,8 +331,10 @@ export const ClientConfigStore: FC = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
if ((window as any).configHydration) {
|
if ((window as any).configHydration) {
|
||||||
|
sendEvent(AppStateEvent.Loaded);
|
||||||
const config = JSON.parse((window as any).configHydration);
|
const config = JSON.parse((window as any).configHydration);
|
||||||
setClientConfig(config);
|
setClientConfig(config);
|
||||||
|
setHasLoadedConfig(true);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Error parsing config hydration', e);
|
console.error('Error parsing config hydration', e);
|
||||||
@ -342,6 +344,7 @@ export const ClientConfigStore: FC = () => {
|
|||||||
if ((window as any).statusHydration) {
|
if ((window as any).statusHydration) {
|
||||||
const status = JSON.parse((window as any).statusHydration);
|
const status = JSON.parse((window as any).statusHydration);
|
||||||
setServerStatus(status);
|
setServerStatus(status);
|
||||||
|
setHasLoadedStatus(true);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('error parsing status hydration', e);
|
console.error('error parsing status hydration', e);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user