Don't show unsubmitted segments in description box

This commit is contained in:
Ajay
2022-09-18 16:02:52 -04:00
parent 614d6a722a
commit 4970d33169
3 changed files with 7 additions and 5 deletions

View File

@@ -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|-/)));

View File

@@ -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);

View File

@@ -51,3 +51,5 @@ export function getCategorySuffix(category: Category): string {
export function shortCategoryName(categoryName: string): string {
return chrome.i18n.getMessage("category_" + categoryName + "_short") || chrome.i18n.getMessage("category_" + categoryName);
}
export const DEFAULT_CATEGORY = "chooseACategory";