From 444b90cac228fb53463326edeab5c7b3fbcee65d Mon Sep 17 00:00:00 2001 From: felistachio Date: Sun, 21 Sep 2025 13:26:23 -0700 Subject: [PATCH] simplify tabFilter --- src/popup/SegmentListComponent.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/popup/SegmentListComponent.tsx b/src/popup/SegmentListComponent.tsx index 31c530b5..4275eef6 100644 --- a/src/popup/SegmentListComponent.tsx +++ b/src/popup/SegmentListComponent.tsx @@ -68,14 +68,6 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => { } }, [props.videoID, hasSegments]); - const tabFilter = (segment: SponsorTime) => { - if (tab === SegmentListTab.Chapter) { - return isChapter(segment); - } else { - return isSegment(segment); - } - }; - const segmentsWithNesting = React.useMemo(() => { const result: SegmentWithNesting[] = []; let nbTrailingNonChapters = 0; @@ -141,7 +133,7 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => { isVip={isVip} loopedChapter={props.loopedChapter} // UUID instead of boolean so it can be passed down to nested chapters - tabFilter={tabFilter} + tabFilter={tab === SegmentListTab.Chapter ? isChapter : isSegment} sendMessage={props.sendMessage} /> ))