diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 74ad57fd..0f2af9c6 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -8,6 +8,7 @@ import { RectangleTooltip } from "../render/RectangleTooltip"; import SelectorComponent, { SelectorOption } from "./SelectorComponent"; import { GenericUtils } from "../utils/genericUtils"; import { noRefreshFetchingChaptersAllowed } from "../utils/licenseKey"; +import { DEFAULT_CATEGORY } from "../utils/categoryUtils"; const utils = new Utils(); @@ -33,8 +34,6 @@ export interface SponsorTimeEditState { chapterNameSelectorOpen: boolean; } -const DEFAULT_CATEGORY = "chooseACategory"; - const categoryNamesGrams: string[] = [].concat(...CompileConfig.categoryList.filter((name) => name !== "chapter") .map((name) => chrome.i18n.getMessage("category_" + name).split(/\/|\s|-/))); diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index a9d09e8a..e97640e3 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -9,7 +9,7 @@ import Config from "../config"; import { ChapterVote } from "../render/ChapterVote"; import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceType, SponsorTime } from "../types"; import { partition } from "../utils/arrayUtils"; -import { shortCategoryName } from "../utils/categoryUtils"; +import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils"; import { GenericUtils } from "../utils/genericUtils"; import { findValidElement } from "../utils/pageUtils"; @@ -708,7 +708,8 @@ class PreviewBar { if (submittingSegments?.length > 0) segments = segments.concat(submittingSegments); const activeSegments = segments.filter((segment) => { return segment.hidden === SponsorHideType.Visible - && segment.segment[0] <= currentTime && segment.segment[1] > currentTime; + && segment.segment[0] <= currentTime && segment.segment[1] > currentTime + && segment.category !== DEFAULT_CATEGORY; }); this.setActiveSegments(activeSegments); diff --git a/src/utils/categoryUtils.ts b/src/utils/categoryUtils.ts index e6bc175e..d93c2c7b 100644 --- a/src/utils/categoryUtils.ts +++ b/src/utils/categoryUtils.ts @@ -50,4 +50,6 @@ export function getCategorySuffix(category: Category): string { export function shortCategoryName(categoryName: string): string { return chrome.i18n.getMessage("category_" + categoryName + "_short") || chrome.i18n.getMessage("category_" + categoryName); -} \ No newline at end of file +} + +export const DEFAULT_CATEGORY = "chooseACategory"; \ No newline at end of file