Protect against missing element
This commit is contained in:
+4
-5
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user