diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 862d69bc..7d9a496e 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -571,6 +571,12 @@ "moreCategories": { "message": "More Categories" }, + "chooseACategory": { + "message": "Choose a Category" + }, + "youMustSelectACategory": { + "message": "You must select a category for all segments you are submitting!" + }, "bracketEnd": { "message": "(End)" }, diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index efcf595a..396bfba8 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -230,7 +230,12 @@ class SponsorTimeEditComponent extends React.Component + {chrome.i18n.getMessage("chooseACategory")} + + )]; for (const category of Config.config.categorySelections) { elements.push( diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index a545c340..aa59b3c2 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -167,9 +167,16 @@ class SubmissionNoticeComponent extends React.Component, segmentTimes: SBMap, + defaultCategory: string, whitelistedChannels: string[], forceChannelCheck: boolean, startSponsorKeybind: string, @@ -40,6 +41,7 @@ interface SBConfig { // Preview bar barTypes: { + "preview-chooseACategory": PreviewBarOption, "sponsor": PreviewBarOption, "preview-sponsor": PreviewBarOption, "intro": PreviewBarOption, @@ -137,6 +139,7 @@ var Config: SBObject = { defaults: { userID: null, segmentTimes: new SBMap("segmentTimes"), + defaultCategory: "chooseACategory", whitelistedChannels: [], forceChannelCheck: false, startSponsorKeybind: ";", @@ -171,6 +174,10 @@ var Config: SBObject = { // Preview bar barTypes: { + "preview-chooseACategory": { + color: "#ffffff", + opacity: "0.7" + }, "sponsor": { color: "#00d400", opacity: "0.7" diff --git a/src/content.ts b/src/content.ts index 7a74ddc3..7e4c190e 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1150,8 +1150,7 @@ function startSponsorClicked() { sponsorTimesSubmitting.push({ segment: [getRealCurrentTime()], UUID: null, - // Default to sponsor - category: "sponsor" + category: Config.config.defaultCategory }); } diff --git a/src/popup.ts b/src/popup.ts index 239fefbd..68f208c7 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -338,7 +338,7 @@ async function runThePopup(messageListener?: MessageListener) { if (sponsorTimes[sponsorTimesIndex] == undefined) { sponsorTimes[sponsorTimesIndex] = { segment: [], - category: "sponsor", + category: Config.config.defaultCategory, UUID: null }; }