Lame fix for Flash of Welcome Page (FoWP)
useEffect runs after mounted so Welcome component appears for a split second
This commit is contained in:
parent
eba78e3f07
commit
c828f53f09
1 changed files with 3 additions and 1 deletions
|
@ -104,7 +104,7 @@ async function startStream() {
|
||||||
export function App() {
|
export function App() {
|
||||||
const snapStates = useSnapshot(states);
|
const snapStates = useSnapshot(states);
|
||||||
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
||||||
const [uiState, setUIState] = useState('default');
|
const [uiState, setUIState] = useState('loading');
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
const theme = store.local.get('theme');
|
const theme = store.local.get('theme');
|
||||||
|
@ -194,6 +194,8 @@ export function App() {
|
||||||
}
|
}
|
||||||
setUIState('default');
|
setUIState('default');
|
||||||
})();
|
})();
|
||||||
|
} else {
|
||||||
|
setUIState('default');
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue