Add configuration for segment failed to fetch warning

This commit is contained in:
Ajay
2022-10-30 20:38:48 -04:00
parent 6db498ccb1
commit b3afd0403e
2 changed files with 4 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ interface SBConfig {
showCategoryWithoutPermission: boolean; showCategoryWithoutPermission: boolean;
showSegmentNameInChapterBar: boolean; showSegmentNameInChapterBar: boolean;
useVirtualTime: boolean; useVirtualTime: boolean;
showSegmentFailedToFetchWarning: boolean;
// Used to cache calculated text color info // Used to cache calculated text color info
categoryPillColors: { categoryPillColors: {
@@ -202,6 +203,7 @@ const Config: SBObject = {
showCategoryWithoutPermission: false, showCategoryWithoutPermission: false,
showSegmentNameInChapterBar: true, showSegmentNameInChapterBar: true,
useVirtualTime: true, useVirtualTime: true,
showSegmentFailedToFetchWarning: true,
categoryPillColors: {}, categoryPillColors: {},

View File

@@ -1926,7 +1926,8 @@ function startOrEndTimingNewSegment() {
importExistingChapters(false); importExistingChapters(false);
if (lastResponseStatus !== 200 && lastResponseStatus !== 404 && !shownSegmentFailedToFetchWarning) { if (lastResponseStatus !== 200 && lastResponseStatus !== 404
&& !shownSegmentFailedToFetchWarning && Config.config.showSegmentFailedToFetchWarning) {
alert(chrome.i18n.getMessage("segmentFetchFailureWarning")); alert(chrome.i18n.getMessage("segmentFetchFailureWarning"));
shownSegmentFailedToFetchWarning = true; shownSegmentFailedToFetchWarning = true;