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;
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: {},

View file

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