diff --git a/src/features/CircleAnimationBar/index.tsx b/src/features/CircleAnimationBar/index.tsx index 6bf1acca..7139059d 100644 --- a/src/features/CircleAnimationBar/index.tsx +++ b/src/features/CircleAnimationBar/index.tsx @@ -2,6 +2,7 @@ import type { Dispatch, SetStateAction } from 'react' import { useEffect } from 'react' import isEmpty from 'lodash/isEmpty' +import size from 'lodash/size' import type { Events } from 'requests' @@ -52,10 +53,15 @@ export const CircleAnimationBar = ({ const currentEpisodesPercent = 100 - (100 / (timeOfAllEpisodes / currentAnimationTime)) useEffect(() => { - if (currentEpisodesPercent >= 100) { + if (currentEpisodesPercent >= 100 && (plaingOrder === size(filteredEvents))) { setWatchAllEpisodesTimer(false) } - }, [currentEpisodesPercent, setWatchAllEpisodesTimer]) + }, [ + currentEpisodesPercent, + filteredEvents, + plaingOrder, + setWatchAllEpisodesTimer, + ]) return (