diff options
author | LASER-Yi <[email protected]> | 2021-04-23 21:20:56 +0800 |
---|---|---|
committer | LASER-Yi <[email protected]> | 2021-04-23 21:20:56 +0800 |
commit | 01b76983a797cf8c93fa281c0dcaebd76be4b42f (patch) | |
tree | e7e173ffc5a62c7bfe53c671cddaef5dbf1340fd | |
parent | e77cb153f1e6d9c4c6f9de9087bc02b95d6a600a (diff) | |
download | bazarr-01b76983a797cf8c93fa281c0dcaebd76be4b42f.tar.gz bazarr-01b76983a797cf8c93fa281c0dcaebd76be4b42f.zip |
Fix display issue of badges when Sonarr or Radarr is disabled
-rw-r--r-- | frontend/src/Sidebar/index.tsx | 12 |
1 files 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<Props> = ({ open }) => { const { movies, episodes, providers } = useReduxStore((s) => s.site.badges); + const sonarrEnabled = useIsSonarrEnabled(); + const radarrEnabled = useIsRadarrEnabled(); + const badges = useMemo<BadgeProvider>( () => ({ 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<string[]>(() => { const list = []; if (!sonarrEnabled) { |