From c828f53f09b868935170be548498513ba2521fbd Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 21 Dec 2022 20:34:24 +0800 Subject: [PATCH] Lame fix for Flash of Welcome Page (FoWP) useEffect runs after mounted so Welcome component appears for a split second --- src/app.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.jsx b/src/app.jsx index 53e6c177..27268c59 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -104,7 +104,7 @@ async function startStream() { export function App() { const snapStates = useSnapshot(states); const [isLoggedIn, setIsLoggedIn] = useState(false); - const [uiState, setUIState] = useState('default'); + const [uiState, setUIState] = useState('loading'); useLayoutEffect(() => { const theme = store.local.get('theme'); @@ -194,6 +194,8 @@ export function App() { } setUIState('default'); })(); + } else { + setUIState('default'); } }, []);