mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
Add warning for submitting multiple highlights
This commit is contained in:
@@ -656,6 +656,9 @@
|
|||||||
"message": "To submit segments with the category of \"{0}\", you must enable it in the options. You will be redirected to the options now.",
|
"message": "To submit segments with the category of \"{0}\", you must enable it in the options. You will be redirected to the options now.",
|
||||||
"description": "Used when submitting segments to only let them select a certain category if they have it enabled in the options."
|
"description": "Used when submitting segments to only let them select a certain category if they have it enabled in the options."
|
||||||
},
|
},
|
||||||
|
"poiOnlyOneSegment": {
|
||||||
|
"message": "Warning: This type of segment can have a maximum of one active at a time. Submitting multiple will cause a random one to be shown."
|
||||||
|
},
|
||||||
"youMustSelectACategory": {
|
"youMustSelectACategory": {
|
||||||
"message": "You must select a category for all segments you are submitting!"
|
"message": "You must select a category for all segments you are submitting!"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -279,6 +279,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
if (getCategoryActionType(event.target.value as Category) === CategoryActionType.POI) {
|
if (getCategoryActionType(event.target.value as Category) === CategoryActionType.POI) {
|
||||||
this.setTimeTo(1, null);
|
this.setTimeTo(1, null);
|
||||||
this.props.contentContainer().updateEditButtonsOnPlayer();
|
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();
|
this.saveEditTimes();
|
||||||
|
|||||||
Reference in New Issue
Block a user