diff options
author | Ajay Ramachandran <[email protected]> | 2021-06-25 10:30:49 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-06-25 10:30:49 -0400 |
commit | 31855f75018b4f7246442b27baf48b3c1c8b68f2 (patch) | |
tree | aa77dbde3e4604829674986c41e0d6ece69f9f54 | |
parent | 278394e48ab87a02d87c6a38a2658eae5ef06ec4 (diff) | |
download | SponsorBlock-31855f75018b4f7246442b27baf48b3c1c8b68f2.tar.gz SponsorBlock-31855f75018b4f7246442b27baf48b3c1c8b68f2.zip |
Show all categories when voting to change category
-rw-r--r-- | src/components/SkipNoticeComponent.tsx | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index c82249e0..74a26872 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -242,8 +242,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta <select id={"sponsorTimeCategories" + this.idSuffix} className="sponsorTimeCategories" defaultValue={this.segments[0].category} //Just default to the first segment, as we don't know which they'll choose - ref={this.categoryOptionRef} - onChange={this.categorySelectionChange.bind(this)}> + ref={this.categoryOptionRef}> {this.getCategoryOptions()} </select> @@ -388,21 +387,11 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta getCategoryOptions(): React.ReactElement[] { const elements = []; - for (const category of Config.config.categorySelections) { + for (const category of CompileConfig.categoryList) { elements.push( - <option value={category.name} - key={category.name}> - {chrome.i18n.getMessage("category_" + category.name)} - </option> - ); - } - - if (elements.length < CompileConfig.categoryList.length) { - // Add show more button - elements.push( - <option value={"moreCategories"} - key={"moreCategories"}> - {chrome.i18n.getMessage("moreCategories")} + <option value={category} + key={category}> + {chrome.i18n.getMessage("category_" + category)} </option> ); } @@ -410,18 +399,6 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta return elements; } - categorySelectionChange(event: React.ChangeEvent<HTMLSelectElement>): void { - // See if show more categories was pressed - if (event.target.value === "moreCategories") { - // Open options page - chrome.runtime.sendMessage({"message": "openConfig"}); - - // Reset option to original - event.target.value = this.segments[0].category; - return; - } - } - unskip(index: number): void { this.contentContainer().unskipSponsorTime(this.segments[index]); |