From 01b76983a797cf8c93fa281c0dcaebd76be4b42f Mon Sep 17 00:00:00 2001 From: LASER-Yi Date: Fri, 23 Apr 2021 21:20:56 +0800 Subject: [PATCH] Fix display issue of badges when Sonarr or Radarr is disabled --- frontend/src/Sidebar/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/Sidebar/index.tsx b/frontend/src/Sidebar/index.tsx index 54cf624f9..339ab4768 100644 --- a/frontend/src/Sidebar/index.tsx +++ b/frontend/src/Sidebar/index.tsx @@ -42,22 +42,22 @@ const Sidebar: FunctionComponent = ({ open }) => { const { movies, episodes, providers } = useReduxStore((s) => s.site.badges); + const sonarrEnabled = useIsSonarrEnabled(); + const radarrEnabled = useIsRadarrEnabled(); + const badges = useMemo( () => ({ Wanted: { - Series: episodes, - Movies: movies, + Series: sonarrEnabled ? episodes : 0, + Movies: radarrEnabled ? movies : 0, }, System: { Providers: providers, }, }), - [movies, episodes, providers] + [movies, episodes, providers, sonarrEnabled, radarrEnabled] ); - const sonarrEnabled = useIsSonarrEnabled(); - const radarrEnabled = useIsRadarrEnabled(); - const hiddenKeys = useMemo(() => { const list = []; if (!sonarrEnabled) {