Skip to content

Commit bbdf950

Browse files
committed
Don't show loading episodes if no followed shows
1 parent 875aba3 commit bbdf950

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

front/src/features/calendar/CalendarHeader.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { MdOutlineResetTv } from 'react-icons/md';
77
import { useIsMobile } from '~/hooks/useIsMobile';
88
import { useAppSelector } from '~/store';
99
import { followApi } from '~/store/rtk/api/follow.api';
10+
import { selectFollowedShows } from '~/store/rtk/slices/user.selectors';
1011
import {
1112
selectCalendarEpisodesForDisplay,
1213
selectIsLoadingCalendarEpisodes,
@@ -28,6 +29,7 @@ const CalendarHeader = ({ calendarRef, title, viewRange }: Props) => {
2829
const isLoadingCalendarEpisodes = useAppSelector(
2930
selectIsLoadingCalendarEpisodes
3031
);
32+
const followedShows = useAppSelector(selectFollowedShows);
3133
const { isLoading: isLoadingFollowedShows } = useAppSelector(
3234
followApi.endpoints.getFollowedShows.select(undefined)
3335
);
@@ -76,7 +78,10 @@ const CalendarHeader = ({ calendarRef, title, viewRange }: Props) => {
7678
<Box>
7779
{!isMobile && (
7880
<LoadingEpisodesBanner
79-
isLoading={isLoadingCalendarEpisodes || isLoadingFollowedShows}
81+
isLoading={
82+
followedShows.length > 0 &&
83+
(isLoadingCalendarEpisodes || isLoadingFollowedShows)
84+
}
8085
hasNoEpisodesThisMonth={!hasEpisodesInCurrentMonth}
8186
/>
8287
)}

0 commit comments

Comments
 (0)