fix: improve loading display

This commit is contained in:
hippoz 2021-09-15 14:19:40 +03:00
parent d9129b826b
commit 9f146de154
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -6,7 +6,7 @@ import Notification from '../UI/Notification';
import './../../Styles/App.scss'; import './../../Styles/App.scss';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useDispatch, connect } from 'react-redux' import { connect } from 'react-redux'
import { BrowserRouter, Switch, Route } from 'react-router-dom'; import { BrowserRouter, Switch, Route } from 'react-router-dom';
import LoggedInMount from './LoggedInMount'; import LoggedInMount from './LoggedInMount';
import FullMessage from '../UI/FullMessage'; import FullMessage from '../UI/FullMessage';
@ -15,13 +15,11 @@ function App({ user, fullscreenMessage }) {
const [ notificationText ] = useState(''); const [ notificationText ] = useState('');
const [ hasError ] = useState(false); const [ hasError ] = useState(false);
const dispatch = useDispatch();
useEffect(() => { useEffect(() => {
Authenticator.login(); Authenticator.login();
}, [dispatch]); }, []);
if (user === null && !hasError) { if (!user && !hasError) {
return ( return (
<p> <p>
Loading... Loading...