diff --git a/frontend/src/pages/videos/VideoRatings.tsx b/frontend/src/pages/videos/VideoRatings.tsx index f348a79329..be7ae2d40c 100644 --- a/frontend/src/pages/videos/VideoRatings.tsx +++ b/frontend/src/pages/videos/VideoRatings.tsx @@ -44,7 +44,10 @@ const NoRatingMessage = ({ hasFilter }: { hasFilter: boolean }) => { const VideoRatingsPage = () => { const { name: pollName, options } = useCurrentPoll(); - const [ratings, setRatings] = useState({}); + const [ratings, setRatings] = useState({ + count: 0, + results: [], + }); const [isLoading, setIsLoading] = useState(true); const location = useLocation(); const history = useHistory(); @@ -52,7 +55,6 @@ const VideoRatingsPage = () => { const searchParams = new URLSearchParams(location.search); const limit = 20; const offset = Number(searchParams.get('offset') || 0); - const videoCount = ratings.count || 0; const hasFilter = searchParams.get('isPublic') != null; const handleOffsetChange = (newOffset: number) => { @@ -119,10 +121,10 @@ const VideoRatingsPage = () => { displayContextAlert={true} /> - {!isLoading && videoCount > 0 && videoCount > limit && ( + {!isLoading && ratings.count > 0 && ratings.count > limit && (