mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 22:17:21 +03:00
Fix: prevent auto-switch tab on refresh
This commit is contained in:
@@ -48,9 +48,7 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
|
|||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const hasSegments = props.segments.find(seg => seg.actionType !== ActionType.Chapter)
|
const hasSegments = props.segments.find(seg => seg.actionType !== ActionType.Chapter)
|
||||||
if (hasSegments) {
|
if (!hasSegments && props.segments.length > 0) {
|
||||||
setTab(SegmentListTab.Segments);
|
|
||||||
} else {
|
|
||||||
setTab(SegmentListTab.Chapter);
|
setTab(SegmentListTab.Chapter);
|
||||||
}
|
}
|
||||||
}, [props.videoID, props.segments]);
|
}, [props.videoID, props.segments]);
|
||||||
|
|||||||
Reference in New Issue
Block a user