Skip to content

Commit 758b6f1

Browse files
committed
update buttons when single time segment is edited
1 parent 6d05b2a commit 758b6f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/SponsorTimeEditComponent.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,14 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
541541
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
542542
if (time === null) time = sponsorTime.segment[0];
543543

544+
const addedTime = sponsorTime.segment.length === 1;
544545
sponsorTime.segment[index] = time;
545546
if (sponsorTime.actionType === ActionType.Poi) sponsorTime.segment[1] = time;
546547

548+
if (addedTime) {
549+
this.props.contentContainer().updateEditButtonsOnPlayer();
550+
}
551+
547552
this.setState({
548553
sponsorTimeEdits: this.getFormattedSponsorTimesEdits(sponsorTime)
549554
}, () => this.saveEditTimes());
@@ -583,7 +588,12 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
583588

584589
// Change segment time only if the format was correct
585590
if (startTime !== null && endTime !== null) {
591+
const addingTime = sponsorTimesSubmitting[this.props.index].segment.length === 1;
586592
sponsorTimesSubmitting[this.props.index].segment = [startTime, endTime];
593+
594+
if (addingTime) {
595+
this.props.contentContainer().updateEditButtonsOnPlayer();
596+
}
587597
}
588598
} else if (this.state.sponsorTimeEdits[1] === null && category === "outro") {
589599
sponsorTimesSubmitting[this.props.index].segment[1] = this.props.contentContainer().v.duration;

0 commit comments

Comments
 (0)