diff --git a/src/components/toolbar/AppToolbar.tsx b/src/components/toolbar/AppToolbar.tsx index 8ed92eee16..0cc55b339d 100644 --- a/src/components/toolbar/AppToolbar.tsx +++ b/src/components/toolbar/AppToolbar.tsx @@ -6,7 +6,7 @@ import Toolbar from '@mui/material/Toolbar'; import Tooltip from '@mui/material/Tooltip'; import Typography from '@mui/material/Typography'; import React, { FC, ReactNode } from 'react'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; import appIcon from 'assets/img/icon-transparent.png'; import { appRouter } from 'components/router/appRouter'; @@ -38,9 +38,16 @@ const AppToolbar: FC = ({ }) => { const { user } = useApi(); const isUserLoggedIn = Boolean(user); + const currentLocation = useLocation(); const isBackButtonAvailable = appRouter.canGoBack(); + // Handles a specific case to hide the user menu on the select server page while authenticated + let isUserMenuAvailable = true; + if (currentLocation.pathname == '/selectserver.html') { + isUserMenuAvailable = false; + } + return ( = ({ {children} - {isUserLoggedIn && ( + {isUserLoggedIn && isUserMenuAvailable && ( <> {buttons}