mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 22:47:18 +03:00
Default to blank category when submitting
This commit is contained in:
@@ -230,7 +230,12 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
||||
}
|
||||
|
||||
getCategoryOptions() {
|
||||
let elements = [];
|
||||
let elements = [(
|
||||
<option value={"chooseACategory"}
|
||||
key={"chooseACategory"}>
|
||||
{chrome.i18n.getMessage("chooseACategory")}
|
||||
</option>
|
||||
)];
|
||||
|
||||
for (const category of Config.config.categorySelections) {
|
||||
elements.push(
|
||||
|
||||
@@ -167,9 +167,16 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
|
||||
ref.current.saveEditTimes();
|
||||
}
|
||||
|
||||
let sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
|
||||
for (const sponsorTime of sponsorTimesSubmitting) {
|
||||
if (sponsorTime.category === "chooseACategory") {
|
||||
alert(chrome.i18n.getMessage("youMustSelectACategory"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if any non music categories are being used on a music video
|
||||
if (this.contentContainer().videoInfo?.microformat?.playerMicroformatRenderer?.category === "Music") {
|
||||
let sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
|
||||
for (const sponsorTime of sponsorTimesSubmitting) {
|
||||
if (!sponsorTime.category.startsWith("music_")) {
|
||||
if (!confirm(chrome.i18n.getMessage("nonMusicCategoryOnMusic"))) return;
|
||||
|
||||
Reference in New Issue
Block a user