fix: respect selectedVideoId

This commit is contained in:
Botzy 2026-05-15 17:54:37 +03:00
parent f85991dd8b
commit 4bf2542643

View file

@ -93,7 +93,8 @@ const VideosList = ({ className, metaItem, libraryItem, season, seasonOnSelect,
isMountedRef.current = true;
return;
}
if (videosContainerRef.current) {
const hasSelectedVideo = videosForSeason.some((v) => v.id === selectedVideoId);
if (!hasSelectedVideo && videosContainerRef.current) {
videosContainerRef.current.scrollTo({ top: 0, behavior: 'smooth' });
}
}, [selectedSeason]);