File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
frontend/src/libs/components/router Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { Route } from 'react-router-dom' ;
2
2
3
3
import { AppRoute } from '~/libs/enums/enums.js' ;
4
- import { useGetCurrentUser } from '~/libs/hooks/hooks.js' ;
4
+ import { useEffect , useGetCurrentUser } from '~/libs/hooks/hooks.js' ;
5
5
import { UserGroupKey } from '~/packages/users/libs/enums/enums.js' ;
6
6
import { Auth } from '~/pages/auth/auth.js' ;
7
7
import { Dashboard } from '~/pages/dashboard/dashboard.js' ;
8
8
import { NotFound } from '~/pages/not-found/not-found.js' ;
9
9
import { WelcomePage } from '~/pages/welcome/welcome.js' ;
10
10
11
- import { App , PageLayout , ProtectedRoute } from '../components.js' ;
11
+ import { PageLayout , ProtectedRoute } from '../components.js' ;
12
12
import { RouterProvider } from '../router-provider/router-provider.js' ;
13
13
14
14
const Router = ( ) : JSX . Element => {
15
15
const { getCurrentUser } = useGetCurrentUser ( ) ;
16
- void getCurrentUser ( ) ;
16
+
17
+ useEffect ( ( ) => {
18
+ void getCurrentUser ( ) ;
19
+ } , [ getCurrentUser ] ) ;
17
20
18
21
return (
19
22
< RouterProvider >
20
- < Route path = { AppRoute . ROOT } element = { < App /> } >
23
+ < Route path = { AppRoute . ROOT } element = { < PageLayout isSidebarHidden /> } >
21
24
< Route path = { AppRoute . WELCOME } element = { < WelcomePage /> } />
22
25
< Route path = { AppRoute . SIGN_IN } element = { < Auth /> } />
23
26
< Route path = { AppRoute . SIGN_UP } element = { < Auth /> } />
You can’t perform that action at this time.
0 commit comments