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:
commit
f838472856
1 changed files with 6 additions and 2 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue