From df74ecb1ec1a2306c444ecad189f92da180bb5df Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 19 Jun 2026 22:05:12 -0400 Subject: [PATCH] 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 --- ui/src/layout/AppBar.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/src/layout/AppBar.jsx b/ui/src/layout/AppBar.jsx index 510af7eaa..eaebad94e 100644 --- a/ui/src/layout/AppBar.jsx +++ b/ui/src/layout/AppBar.jsx @@ -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') && ( - - )} + {config.devActivityPanel && canViewNowPlaying && } {config.devActivityPanel && permissions === 'admin' && }