Added error when segments haven't loaded and improved popup message

Resolves #1553
This commit is contained in:
Ajay
2022-10-27 21:46:47 -04:00
parent fea8a9a37e
commit 715bcb6bd3
3 changed files with 21 additions and 1 deletions

View File

@@ -56,6 +56,7 @@ let sponsorVideoID: VideoID = null;
const skipNotices: SkipNotice[] = [];
let activeSkipKeybindElement: ToggleSkippable = null;
let retryFetchTimeout: NodeJS.Timeout = null;
let shownSegmentFailedToFetchWarning = false;
// JSON video info
let videoInfo: VideoInfo = null;
@@ -344,6 +345,8 @@ function resetValues() {
sponsorTimes = [];
existingChaptersImported = false;
sponsorSkipped = [];
lastResponseStatus = 0;
shownSegmentFailedToFetchWarning = false;
sponsorVideoID = null;
videoInfo = null;
@@ -1922,6 +1925,12 @@ function startOrEndTimingNewSegment() {
updateSponsorTimesSubmitting(false);
importExistingChapters(false);
if (lastResponseStatus !== 200 && !shownSegmentFailedToFetchWarning) {
alert(chrome.i18n.getMessage("segmentFetchFailureWarning"));
shownSegmentFailedToFetchWarning = true;
}
}
function getIncompleteSegment(): SponsorTime {