From b3afd0403e3f3ab83aa6fc01ad71c9d6bfda1161 Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 30 Oct 2022 20:38:48 -0400 Subject: [PATCH] Add configuration for segment failed to fetch warning --- src/config.ts | 2 ++ src/content.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 8d5ad5a0..ba3caf85 100644 --- a/src/config.ts +++ b/src/config.ts @@ -68,6 +68,7 @@ interface SBConfig { showCategoryWithoutPermission: boolean; showSegmentNameInChapterBar: boolean; useVirtualTime: boolean; + showSegmentFailedToFetchWarning: boolean; // Used to cache calculated text color info categoryPillColors: { @@ -202,6 +203,7 @@ const Config: SBObject = { showCategoryWithoutPermission: false, showSegmentNameInChapterBar: true, useVirtualTime: true, + showSegmentFailedToFetchWarning: true, categoryPillColors: {}, diff --git a/src/content.ts b/src/content.ts index a1afa590..b74c9d11 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1926,7 +1926,8 @@ function startOrEndTimingNewSegment() { importExistingChapters(false); - if (lastResponseStatus !== 200 && lastResponseStatus !== 404 && !shownSegmentFailedToFetchWarning) { + if (lastResponseStatus !== 200 && lastResponseStatus !== 404 + && !shownSegmentFailedToFetchWarning && Config.config.showSegmentFailedToFetchWarning) { alert(chrome.i18n.getMessage("segmentFetchFailureWarning")); shownSegmentFailedToFetchWarning = true;