This commit is contained in:
felistachio
2025-09-20 17:27:46 -07:00
parent 7ccdf67195
commit 9e501a5f66

View File

@@ -47,11 +47,11 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
}, []); }, []);
React.useEffect(() => { React.useEffect(() => {
const hasNonChapter = props.segments.find(seg => seg.actionType !== ActionType.Chapter) const hasSegments = props.segments.find(seg => seg.actionType !== ActionType.Chapter)
if (!hasNonChapter && props.segments.length > 0) { if (hasSegments) {
setTab(SegmentListTab.Chapter);
} else {
setTab(SegmentListTab.Segments); setTab(SegmentListTab.Segments);
} else {
setTab(SegmentListTab.Chapter);
} }
}, [props.videoID, props.segments]); }, [props.videoID, props.segments]);