Formatting fixes and add locales

This commit is contained in:
Ajay
2025-09-18 03:19:00 -04:00
parent 86a7920590
commit 299560ec9a
2 changed files with 17 additions and 17 deletions

View File

@@ -58,12 +58,10 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
} }
}; };
const segmentsWithNesting: segmentWithNesting[] = [] const segmentsWithNesting: segmentWithNesting[] = [];
let nbTrailingNonChapters = 0 let nbTrailingNonChapters = 0;
function nestChapters(segments: segmentWithNesting[], seg: SponsorTime, topLevel?:boolean){ function nestChapters(segments: segmentWithNesting[], seg: SponsorTime, topLevel?: boolean) {
if (seg.actionType === ActionType.Chapter if (seg.actionType === ActionType.Chapter && segments.length) {
&& segments.length)
{
// trailing non-chapters can only exist at top level // trailing non-chapters can only exist at top level
const lastElement = segments[segments.length - (topLevel ? nbTrailingNonChapters + 1 : 1)] const lastElement = segments[segments.length - (topLevel ? nbTrailingNonChapters + 1 : 1)]
@@ -75,18 +73,22 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
} else { } else {
lastElement.innerChapters = [seg]; lastElement.innerChapters = [seg];
} }
} else {
if (topLevel) {
nbTrailingNonChapters = 0;
} }
else {
if (topLevel){nbTrailingNonChapters = 0}
segments.push(seg); segments.push(seg);
} }
} else { } else {
if (seg.actionType !== ActionType.Chapter){nbTrailingNonChapters++} if (seg.actionType !== ActionType.Chapter) {
nbTrailingNonChapters++;
}
segments.push(seg); segments.push(seg);
} }
} }
props.segments.forEach((seg) => {nestChapters(segmentsWithNesting, {...seg}, true)}) props.segments.forEach((seg) => nestChapters(segmentsWithNesting, {...seg}, true));
return ( return (
<div id="issueReporterContainer"> <div id="issueReporterContainer">
@@ -160,7 +162,6 @@ function SegmentListItem({ segment, videoID, currentTime, isVip, loopedChapter,
return ( return (
<div className={"segmentWrapper " + (!tabFilter(segment) ? "hidden" : "")}> <div className={"segmentWrapper " + (!tabFilter(segment) ? "hidden" : "")}>
{
<details data-uuid={segment.UUID} <details data-uuid={segment.UUID}
onDoubleClick={() => skipSegment({ onDoubleClick={() => skipSegment({
segment, segment,
@@ -250,7 +251,6 @@ function SegmentListItem({ segment, videoID, currentTime, isVip, loopedChapter,
stopAnimation(); stopAnimation();
} }
stopAnimation();
}}/> }}/>
{ {
segment.actionType === ActionType.Chapter && segment.actionType === ActionType.Chapter &&
@@ -325,7 +325,7 @@ function SegmentListItem({ segment, videoID, currentTime, isVip, loopedChapter,
</div> </div>
</div> </div>
</details> </details>
}
{ {
segment.innerChapters segment.innerChapters
&& <InnerChapterList && <InnerChapterList