mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 13:37:04 +03:00
Don't show unsubmitted segments in description box
This commit is contained in:
@@ -8,6 +8,7 @@ import { RectangleTooltip } from "../render/RectangleTooltip";
|
|||||||
import SelectorComponent, { SelectorOption } from "./SelectorComponent";
|
import SelectorComponent, { SelectorOption } from "./SelectorComponent";
|
||||||
import { GenericUtils } from "../utils/genericUtils";
|
import { GenericUtils } from "../utils/genericUtils";
|
||||||
import { noRefreshFetchingChaptersAllowed } from "../utils/licenseKey";
|
import { noRefreshFetchingChaptersAllowed } from "../utils/licenseKey";
|
||||||
|
import { DEFAULT_CATEGORY } from "../utils/categoryUtils";
|
||||||
|
|
||||||
|
|
||||||
const utils = new Utils();
|
const utils = new Utils();
|
||||||
@@ -33,8 +34,6 @@ export interface SponsorTimeEditState {
|
|||||||
chapterNameSelectorOpen: boolean;
|
chapterNameSelectorOpen: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_CATEGORY = "chooseACategory";
|
|
||||||
|
|
||||||
const categoryNamesGrams: string[] = [].concat(...CompileConfig.categoryList.filter((name) => name !== "chapter")
|
const categoryNamesGrams: string[] = [].concat(...CompileConfig.categoryList.filter((name) => name !== "chapter")
|
||||||
.map((name) => chrome.i18n.getMessage("category_" + name).split(/\/|\s|-/)));
|
.map((name) => chrome.i18n.getMessage("category_" + name).split(/\/|\s|-/)));
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Config from "../config";
|
|||||||
import { ChapterVote } from "../render/ChapterVote";
|
import { ChapterVote } from "../render/ChapterVote";
|
||||||
import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceType, SponsorTime } from "../types";
|
import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceType, SponsorTime } from "../types";
|
||||||
import { partition } from "../utils/arrayUtils";
|
import { partition } from "../utils/arrayUtils";
|
||||||
import { shortCategoryName } from "../utils/categoryUtils";
|
import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils";
|
||||||
import { GenericUtils } from "../utils/genericUtils";
|
import { GenericUtils } from "../utils/genericUtils";
|
||||||
import { findValidElement } from "../utils/pageUtils";
|
import { findValidElement } from "../utils/pageUtils";
|
||||||
|
|
||||||
@@ -708,7 +708,8 @@ class PreviewBar {
|
|||||||
if (submittingSegments?.length > 0) segments = segments.concat(submittingSegments);
|
if (submittingSegments?.length > 0) segments = segments.concat(submittingSegments);
|
||||||
const activeSegments = segments.filter((segment) => {
|
const activeSegments = segments.filter((segment) => {
|
||||||
return segment.hidden === SponsorHideType.Visible
|
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);
|
this.setActiveSegments(activeSegments);
|
||||||
|
|||||||
@@ -50,4 +50,6 @@ export function getCategorySuffix(category: Category): string {
|
|||||||
|
|
||||||
export function shortCategoryName(categoryName: string): string {
|
export function shortCategoryName(categoryName: string): string {
|
||||||
return chrome.i18n.getMessage("category_" + categoryName + "_short") || chrome.i18n.getMessage("category_" + categoryName);
|
return chrome.i18n.getMessage("category_" + categoryName + "_short") || chrome.i18n.getMessage("category_" + categoryName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const DEFAULT_CATEGORY = "chooseACategory";
|
||||||
Reference in New Issue
Block a user