Fix: prevent auto-switch tab on refresh

This commit is contained in:
felistachio
2025-09-20 20:48:23 -07:00
parent 9e501a5f66
commit aa04ed7bf4

View File

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