Add warning for submitting multiple highlights

This commit is contained in:
Ajay Ramachandran
2021-09-10 19:07:16 -04:00
parent cad5cd97fc
commit 1083520666
2 changed files with 8 additions and 0 deletions

View File

@@ -279,6 +279,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
if (getCategoryActionType(event.target.value as Category) === CategoryActionType.POI) {
this.setTimeTo(1, null);
this.props.contentContainer().updateEditButtonsOnPlayer();
if (this.props.contentContainer().sponsorTimesSubmitting
.some((segment, i) => segment.category === event.target.value && i !== this.props.index)) {
alert(chrome.i18n.getMessage("poiOnlyOneSegment"));
}
}
this.saveEditTimes();