Skip to content

Commit

Permalink
[BUG] Fix Auth State in AppBar #116: changed the user state that was …
Browse files Browse the repository at this point in the history
…being initialized in appbar.
  • Loading branch information
ballyalley-o committed Apr 9, 2024
1 parent 0c6a86f commit c4301b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/component/navbar/app-appbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const rightLink = {
function AppNavBar(): JSX.Element {
const [sidebarOpen, setSidebarOpen] = useState(false)
const [isLogoHovered, setIsLogoHovered] = useState(false)
// const { user } = useSelector((state: any) => state.auth)
const { user } = useSelector((state: any) => state.auth)
// avoid re-rendering when user changes
const selectAuth = (state: any) => state.auth
const selectUser = createSelector([selectAuth], (auth) => auth.user || {})
const { user } = useSelector(selectUser)
// const selectAuth = (state: any) => state.auth
// const selectUser = createSelector([selectAuth], (auth) => auth.user || {})
// const { user } = useSelector(selectUser)

const location = useLocation()
const isLogInRoute = location.pathname === AuthPath.LOG_IN
Expand Down

0 comments on commit c4301b5

Please sign in to comment.