Skip to content

Commit 6d05b2a

Browse files
committed
Set endtime by default for outro
1 parent 4729268 commit 6d05b2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/SponsorTimeEditComponent.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
575575

576576
saveEditTimes(): void {
577577
const sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
578+
const category = this.categoryOptionRef.current.value as Category
578579

579580
if (this.state.editing) {
580581
const startTime = GenericUtils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[0]);
@@ -584,9 +585,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
584585
if (startTime !== null && endTime !== null) {
585586
sponsorTimesSubmitting[this.props.index].segment = [startTime, endTime];
586587
}
588+
} else if (this.state.sponsorTimeEdits[1] === null && category === "outro") {
589+
sponsorTimesSubmitting[this.props.index].segment[1] = this.props.contentContainer().v.duration;
590+
this.props.contentContainer().updateEditButtonsOnPlayer();
587591
}
588592

589-
const category = this.categoryOptionRef.current.value as Category
590593
sponsorTimesSubmitting[this.props.index].category = category;
591594

592595
const actionType = this.getNextActionType(category, this.actionTypeOptionRef?.current?.value as ActionType);

0 commit comments

Comments
 (0)