From 9e501a5f667b93bcd42d0059d42b26ce3f599d18 Mon Sep 17 00:00:00 2001 From: felistachio Date: Sat, 20 Sep 2025 17:27:46 -0700 Subject: [PATCH] refactor --- src/popup/SegmentListComponent.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/popup/SegmentListComponent.tsx b/src/popup/SegmentListComponent.tsx index ce4559d1..6e0f62c5 100644 --- a/src/popup/SegmentListComponent.tsx +++ b/src/popup/SegmentListComponent.tsx @@ -47,11 +47,11 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => { }, []); React.useEffect(() => { - const hasNonChapter = props.segments.find(seg => seg.actionType !== ActionType.Chapter) - if (!hasNonChapter && props.segments.length > 0) { - setTab(SegmentListTab.Chapter); - } else { + const hasSegments = props.segments.find(seg => seg.actionType !== ActionType.Chapter) + if (hasSegments) { setTab(SegmentListTab.Segments); + } else { + setTab(SegmentListTab.Chapter); } }, [props.videoID, props.segments]);