mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
update buttons when single time segment is edited
This commit is contained in:
@@ -541,9 +541,14 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
||||
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
|
||||
if (time === null) time = sponsorTime.segment[0];
|
||||
|
||||
const addedTime = sponsorTime.segment.length === 1;
|
||||
sponsorTime.segment[index] = time;
|
||||
if (sponsorTime.actionType === ActionType.Poi) sponsorTime.segment[1] = time;
|
||||
|
||||
if (addedTime) {
|
||||
this.props.contentContainer().updateEditButtonsOnPlayer();
|
||||
}
|
||||
|
||||
this.setState({
|
||||
sponsorTimeEdits: this.getFormattedSponsorTimesEdits(sponsorTime)
|
||||
}, () => this.saveEditTimes());
|
||||
@@ -583,7 +588,12 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
||||
|
||||
// Change segment time only if the format was correct
|
||||
if (startTime !== null && endTime !== null) {
|
||||
const addingTime = sponsorTimesSubmitting[this.props.index].segment.length === 1;
|
||||
sponsorTimesSubmitting[this.props.index].segment = [startTime, endTime];
|
||||
|
||||
if (addingTime) {
|
||||
this.props.contentContainer().updateEditButtonsOnPlayer();
|
||||
}
|
||||
}
|
||||
} else if (this.state.sponsorTimeEdits[1] === null && category === "outro") {
|
||||
sponsorTimesSubmitting[this.props.index].segment[1] = this.props.contentContainer().v.duration;
|
||||
|
||||
Reference in New Issue
Block a user