diff --git a/src/components/App/App.jsx b/src/components/App/App.jsx index b6eaece..9a213b4 100644 --- a/src/components/App/App.jsx +++ b/src/components/App/App.jsx @@ -2,11 +2,9 @@ import { lazy, Suspense, useEffect } from "react"; import { Route, Routes } from "react-router-dom"; import { Toaster } from "react-hot-toast"; import { useDispatch, useSelector } from "react-redux"; -import { refreshUser, getUserInfo } from "../../redux/auth/operations"; -import { - selectIsRefreshing, - selectIsLoggedIn, -} from "../../redux/auth/selectors"; +import { refreshUser } from "../../redux/auth/operations"; +import { selectIsRefreshing } from "../../redux/auth/selectror"; + import RestrictedRoute from "../RestrictedRoute/RestrictedRoute"; import PrivateRoute from "../PrivateRoute/PrivateRoute"; @@ -19,18 +17,18 @@ const NotFoundPage = lazy(() => import("../../pages/NotFoundPage")); export const App = () => { const isRefreshing = useSelector(selectIsRefreshing); - const isLoggedIn = useSelector(selectIsLoggedIn); + // const isLoggedIn = useSelector(selectIsLoggedIn); const dispatch = useDispatch(); useEffect(() => { dispatch(refreshUser()); }, [dispatch]); - useEffect(() => { - if (isLoggedIn) { - dispatch(getUserInfo()); - } - }, [dispatch, isLoggedIn]); + // useEffect(() => { + // if (isLoggedIn) { + // dispatch(getUserInfo()); + // } + // }, [dispatch, isLoggedIn]); return ( <> {isRefreshing ? ( diff --git a/src/components/Header/Header.jsx b/src/components/Header/Header.jsx index d08d478..f76ddf5 100644 --- a/src/components/Header/Header.jsx +++ b/src/components/Header/Header.jsx @@ -62,7 +62,12 @@ export default function Header({ openSideBar, sideBarOpen }) {
{user.name}
Edit Profile