Skip to content

Commit

Permalink
fix(home): display the correct videos count per channel
Browse files Browse the repository at this point in the history
  • Loading branch information
AXeL-dev committed Nov 5, 2022
1 parent f9b31b0 commit dbd4220
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/ChannelVideosProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ export const ChannelVideosProvider: FC = memo(({ children }) => {

const getChannelVideosCount = (view: HomeView, channelId: string) => {
const channelData = channelsMap.current[view].get(channelId);
return channelData?.total || 0;
switch (view) {
case HomeView.All:
return channelData?.items.length || 0;
default:
return channelData?.total || 0;
}
};

const value = useMemo(
Expand Down

0 comments on commit dbd4220

Please sign in to comment.