mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Handled case to not show user menu
This commit is contained in:
parent
94021090ca
commit
60d29cb4f8
1 changed files with 9 additions and 2 deletions
|
@ -6,7 +6,7 @@ import Toolbar from '@mui/material/Toolbar';
|
||||||
import Tooltip from '@mui/material/Tooltip';
|
import Tooltip from '@mui/material/Tooltip';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import React, { FC, ReactNode } from 'react';
|
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 appIcon from 'assets/img/icon-transparent.png';
|
||||||
import { appRouter } from 'components/router/appRouter';
|
import { appRouter } from 'components/router/appRouter';
|
||||||
|
@ -38,9 +38,16 @@ const AppToolbar: FC<AppToolbarProps> = ({
|
||||||
}) => {
|
}) => {
|
||||||
const { user } = useApi();
|
const { user } = useApi();
|
||||||
const isUserLoggedIn = Boolean(user);
|
const isUserLoggedIn = Boolean(user);
|
||||||
|
const currentLocation = useLocation();
|
||||||
|
|
||||||
const isBackButtonAvailable = appRouter.canGoBack();
|
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 (
|
return (
|
||||||
<Toolbar
|
<Toolbar
|
||||||
variant='dense'
|
variant='dense'
|
||||||
|
@ -111,7 +118,7 @@ const AppToolbar: FC<AppToolbarProps> = ({
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
|
|
||||||
{isUserLoggedIn && (
|
{isUserLoggedIn && isUserMenuAvailable && (
|
||||||
<>
|
<>
|
||||||
<Box sx={{ display: 'flex', flexGrow: 1, justifyContent: 'flex-end' }}>
|
<Box sx={{ display: 'flex', flexGrow: 1, justifyContent: 'flex-end' }}>
|
||||||
{buttons}
|
{buttons}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue