We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cbb0ec commit 7ccdf67Copy full SHA for 7ccdf67
src/popup/SegmentListComponent.tsx
@@ -47,8 +47,13 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
47
}, []);
48
49
React.useEffect(() => {
50
- setTab(SegmentListTab.Segments);
51
- }, [props.videoID]);
+ const hasNonChapter = props.segments.find(seg => seg.actionType !== ActionType.Chapter)
+ if (!hasNonChapter && props.segments.length > 0) {
52
+ setTab(SegmentListTab.Chapter);
53
+ } else {
54
+ setTab(SegmentListTab.Segments);
55
+ }
56
+ }, [props.videoID, props.segments]);
57
58
const tabFilter = (segment: SponsorTime) => {
59
if (tab === SegmentListTab.Chapter) {
0 commit comments