Protect against missing element

zio/stable
Paul Frazee 2024-05-06 18:06:31 -07:00
parent 0a8dc289ff
commit 032f849092
1 changed files with 4 additions and 5 deletions

View File

@ -110,15 +110,14 @@ function InnerApp() {
function App() { function App() {
const [isReady, setReady] = useState(false) const [isReady, setReady] = useState(false)
React.useEffect(() => { React.useEffect(() => {
initPersistedState().then(() => { initPersistedState().then(() => {
setReady(true) setReady(true)
const preloadElement = document.getElementById('preload'); const preloadElement = document.getElementById('preload')
preloadElement.remove(); preloadElement?.remove()
}) })
}, []) }, [])
if (!isReady) { if (!isReady) {