1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #4850 from elvinlai1/experimental-layout-issues

Fix user menu shown when authenticated user is on select server page
This commit is contained in:
Bill Thornton 2023-10-20 00:58:08 -04:00 committed by GitHub
commit f838472856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,13 @@ const AppToolbar: FC<AppToolbarProps> = ({
}) => {
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
const isUserMenuAvailable = currentLocation.pathname !== '/selectserver.html';
return (
<Toolbar
variant='dense'
@ -111,7 +115,7 @@ const AppToolbar: FC<AppToolbarProps> = ({
{children}
{isUserLoggedIn && (
{isUserLoggedIn && isUserMenuAvailable && (
<>
<Box sx={{ display: 'flex', flexGrow: 1, justifyContent: 'flex-end' }}>
{buttons}