Add partial segments to upload menu

This commit is contained in:
Ajay Ramachandran
2021-05-21 15:51:58 -04:00
parent 6879e90c16
commit 9392d16617
4 changed files with 40 additions and 44 deletions

View File

@@ -340,13 +340,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
deleteTime(): void {
const sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting;
const index = this.props.index;
const removingIncomplete = sponsorTimes[index].segment.length < 2;
//if it is not a complete sponsor time
if (sponsorTimes[index].segment.length < 2) {
//update video player
this.props.contentContainer().updateEditButtonsOnPlayer();
}
sponsorTimes.splice(index, 1);
//save this
@@ -357,13 +352,16 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
//if they are all removed
if (sponsorTimes.length == 0) {
this.props.submissionNotice.cancel();
//update video player
this.props.contentContainer().updateEditButtonsOnPlayer();
} else {
//update display
this.props.submissionNotice.forceUpdate();
}
//if it is not a complete segment, or all are removed
if (sponsorTimes.length === 0 || removingIncomplete) {
//update video player
this.props.contentContainer().updateEditButtonsOnPlayer();
}
}
configUpdate(): void {