mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-14 07:27:05 +03:00
refactor
This commit is contained in:
@@ -47,11 +47,11 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const hasNonChapter = props.segments.find(seg => seg.actionType !== ActionType.Chapter)
|
const hasSegments = props.segments.find(seg => seg.actionType !== ActionType.Chapter)
|
||||||
if (!hasNonChapter && props.segments.length > 0) {
|
if (hasSegments) {
|
||||||
setTab(SegmentListTab.Chapter);
|
|
||||||
} else {
|
|
||||||
setTab(SegmentListTab.Segments);
|
setTab(SegmentListTab.Segments);
|
||||||
|
} else {
|
||||||
|
setTab(SegmentListTab.Chapter);
|
||||||
}
|
}
|
||||||
}, [props.videoID, props.segments]);
|
}, [props.videoID, props.segments]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user