Skip to content

Commit

Permalink
chore: memoize publishedAfter date in recent view renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
AXeL-dev committed Aug 21, 2022
1 parent a969718 commit 3bbeea8
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function RecentViewRenderer(props: RecentViewRendererProps) {
.filter(({ flags }) => filterVideoByFlags(flags, filters))
.map(({ id }) => id),
}),
[videos, filters]
[videos, filters],
);
const filterCallback = useCallback(
(video: Video) => {
Expand All @@ -37,11 +37,12 @@ function RecentViewRenderer(props: RecentViewRendererProps) {
return inclusionList.includes(video.id);
}
},
[filters.uncategorised, exclusionList, inclusionList]
[filters.uncategorised, exclusionList, inclusionList],
);
const publishedAfter = useMemo(
() => getDateBefore(settings.recentVideosSeniority).toISOString(),
[settings.recentVideosSeniority],
);
const publishedAfter = getDateBefore(
settings.recentVideosSeniority
).toISOString();

return (
<DefaultRenderer
Expand Down

0 comments on commit 3bbeea8

Please sign in to comment.