mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-01 07:21:17 +00:00
refactor(ui): extract NowPlaying visibility check into a named variable
Pulls the compound "enabled && (not admin-only or is admin)" condition out of the JSX into a canViewNowPlaying variable, so the AppBar render reads as intent rather than a multi-operator boolean. No behavior change. Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
4298cec37d
commit
df74ecb1ec
@ -118,13 +118,13 @@ const CustomUserMenu = ({ onClick, ...rest }) => {
|
||||
)
|
||||
}
|
||||
|
||||
const canViewNowPlaying =
|
||||
config.enableNowPlaying &&
|
||||
(!config.nowPlayingAdminOnly || permissions === 'admin')
|
||||
|
||||
return (
|
||||
<>
|
||||
{config.devActivityPanel &&
|
||||
config.enableNowPlaying &&
|
||||
(!config.nowPlayingAdminOnly || permissions === 'admin') && (
|
||||
<NowPlayingPanel />
|
||||
)}
|
||||
{config.devActivityPanel && canViewNowPlaying && <NowPlayingPanel />}
|
||||
{config.devActivityPanel && permissions === 'admin' && <ActivityPanel />}
|
||||
<UserMenu {...rest}>
|
||||
<PersonalMenu sidebarIsOpen={true} onClick={onClick} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user