Added end button to submission notice

This commit is contained in:
Ajay Ramachandran
2020-04-20 00:37:25 -04:00
parent 89f72c185c
commit 9a70599e60
2 changed files with 18 additions and 1 deletions

View File

@@ -133,6 +133,12 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
onClick={() => this.setTimeToNow(1)}>
{chrome.i18n.getMessage("bracketNow")}
</span>
<span id={"endButton" + this.idSuffix}
className="sponsorNowButton"
onClick={() => this.setTimeToEnd()}>
{chrome.i18n.getMessage("bracketEnd")}
</span>
</div>
);
} else {
@@ -230,10 +236,18 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}
setTimeToNow(index: number) {
this.setTimeTo(index, this.props.contentContainer().v.currentTime);
}
setTimeToEnd() {
this.setTimeTo(1, this.props.contentContainer().v.duration);
}
setTimeTo(index: number, time: number) {
let sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
sponsorTime.segment[index] =
this.props.contentContainer().v.currentTime;
time;
this.setState({
sponsorTimeEdits: this.getFormattedSponsorTimesEdits(sponsorTime)