mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
update buttons when single time segment is edited
This commit is contained in:
parent
6d05b2a849
commit
758b6f18db
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue