mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 00:38:49 +01:00
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() {
|
||||
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');
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
|
Loading…
Reference in a new issue