Add review button to submission popup

This commit is contained in:
James Robinson 2020-08-30 02:31:39 -05:00
parent 3ec3a01128
commit fc02816291
2 changed files with 25 additions and 0 deletions

View file

@ -436,6 +436,9 @@
"preview": { "preview": {
"message": "Preview" "message": "Preview"
}, },
"inspect": {
"message": "Inspect"
},
"edit": { "edit": {
"message": "Edit" "message": "Edit"
}, },

View file

@ -218,6 +218,14 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
</span> </span>
): ""} ): ""}
{(!isNaN(segment[1])) ? (
<span id={"sponsorTimeInspectButton" + this.idSuffix}
className="sponsorTimeEditButton"
onClick={this.inspectTime.bind(this)}>
{chrome.i18n.getMessage("inspect")}
</span>
): ""}
{(!isNaN(segment[1])) ? ( {(!isNaN(segment[1])) ? (
<span id={"sponsorTimeEditButton" + this.idSuffix} <span id={"sponsorTimeEditButton" + this.idSuffix}
className="sponsorTimeEditButton" className="sponsorTimeEditButton"
@ -346,6 +354,20 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
this.props.contentContainer().previewTime(skipTime - 2); this.props.contentContainer().previewTime(skipTime - 2);
} }
inspectTime(): void {
let sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting;
let index = this.props.index;
let skipTime = sponsorTimes[index].segment[0];
if (this.state.editing) {
// Save edits before inspecting
this.saveEditTimes();
}
this.props.contentContainer().previewTime(skipTime + 0.000001);
}
deleteTime(): void { deleteTime(): void {
let sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting; let sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting;
let index = this.props.index; let index = this.props.index;