Skip to content

Commit 444b90c

Browse files
simplify tabFilter
1 parent 1b2c3f5 commit 444b90c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/popup/SegmentListComponent.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
6868
}
6969
}, [props.videoID, hasSegments]);
7070

71-
const tabFilter = (segment: SponsorTime) => {
72-
if (tab === SegmentListTab.Chapter) {
73-
return isChapter(segment);
74-
} else {
75-
return isSegment(segment);
76-
}
77-
};
78-
7971
const segmentsWithNesting = React.useMemo(() => {
8072
const result: SegmentWithNesting[] = [];
8173
let nbTrailingNonChapters = 0;
@@ -141,7 +133,7 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
141133
isVip={isVip}
142134
loopedChapter={props.loopedChapter} // UUID instead of boolean so it can be passed down to nested chapters
143135

144-
tabFilter={tabFilter}
136+
tabFilter={tab === SegmentListTab.Chapter ? isChapter : isSegment}
145137
sendMessage={props.sendMessage}
146138
/>
147139
))

0 commit comments

Comments
 (0)