Fix display issue of badges when Sonarr or Radarr is disabled

pull/1386/head
LASER-Yi 4 years ago
parent e77cb153f1
commit 01b76983a7

@ -42,22 +42,22 @@ const Sidebar: FunctionComponent<Props> = ({ open }) => {
const { movies, episodes, providers } = useReduxStore((s) => s.site.badges); const { movies, episodes, providers } = useReduxStore((s) => s.site.badges);
const sonarrEnabled = useIsSonarrEnabled();
const radarrEnabled = useIsRadarrEnabled();
const badges = useMemo<BadgeProvider>( const badges = useMemo<BadgeProvider>(
() => ({ () => ({
Wanted: { Wanted: {
Series: episodes, Series: sonarrEnabled ? episodes : 0,
Movies: movies, Movies: radarrEnabled ? movies : 0,
}, },
System: { System: {
Providers: providers, Providers: providers,
}, },
}), }),
[movies, episodes, providers] [movies, episodes, providers, sonarrEnabled, radarrEnabled]
); );
const sonarrEnabled = useIsSonarrEnabled();
const radarrEnabled = useIsRadarrEnabled();
const hiddenKeys = useMemo<string[]>(() => { const hiddenKeys = useMemo<string[]>(() => {
const list = []; const list = [];
if (!sonarrEnabled) { if (!sonarrEnabled) {

Loading…
Cancel
Save