diff options
Diffstat (limited to 'FrontEnd/src/app/App.tsx')
-rw-r--r-- | FrontEnd/src/app/App.tsx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/FrontEnd/src/app/App.tsx b/FrontEnd/src/app/App.tsx index 6431ebbb..a4363ff5 100644 --- a/FrontEnd/src/app/App.tsx +++ b/FrontEnd/src/app/App.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { ReactElement } from "react"; import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; import AppBar from "./views/common/AppBar"; @@ -13,7 +13,7 @@ import TimelinePage from "./views/timeline"; import Search from "./views/search"; import AlertHost from "./views/common/alert/AlertHost"; -import { userService, useRawUser } from "./services/user"; +import { useRawUser } from "./services/user"; const NoMatch: React.FC = () => { return <div>Ah-oh, 404!</div>; @@ -23,13 +23,9 @@ const LazyAdmin = React.lazy( () => import(/* webpackChunkName: "admin" */ "./views/admin/Admin") ); -const App: React.FC = () => { +function App(): ReactElement | null { const user = useRawUser(); - React.useEffect(() => { - void userService.checkLoginState(); - }, []); - if (user === undefined) { return <LoadingPage />; } else { @@ -82,6 +78,6 @@ const App: React.FC = () => { </React.Suspense> ); } -}; +} export default App; |