From e12d5ff10a6b7e251533b57732b69aa57df8a1a2 Mon Sep 17 00:00:00 2001 From: Ajay Date: Wed, 22 Jun 2022 18:40:36 -0400 Subject: [PATCH] Better category name detection --- src/components/SponsorTimeEditComponent.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 4a7e354f..5b01382c 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -34,8 +34,8 @@ export interface SponsorTimeEditState { const DEFAULT_CATEGORY = "chooseACategory"; -const categoryNames = CompileConfig.categoryList.filter((name) => name !== "chapter") - .map((name) => chrome.i18n.getMessage("category_" + name)); +const categoryNamesGrams: string[] = [].concat(...CompileConfig.categoryList.filter((name) => name !== "chapter") + .map((name) => chrome.i18n.getMessage("category_" + name).split(/\/|\s|-/))); class SponsorTimeEditComponent extends React.Component { @@ -389,7 +389,7 @@ class SponsorTimeEditComponent extends React.Component sponsorTime.description.toLowerCase().includes(category.toLowerCase()))) { if (this.showToolTip(chrome.i18n.getMessage("chapterNameTooltipWarning"), "chapterWarning")) { this.categoryNameWarningShown = true;