diff options
author | Ajay <[email protected]> | 2024-09-23 03:46:19 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2024-09-23 03:46:19 -0400 |
commit | 0d2d5f2eb0e55b0cc3559b846200d209c5d8a3cd (patch) | |
tree | 442fb27bef9c95d430c668e46b361dbd4b42deac | |
parent | e089b837979a143028a0f287b7a5fee2491d6b57 (diff) | |
download | SponsorBlock-0d2d5f2eb0e55b0cc3559b846200d209c5d8a3cd.tar.gz SponsorBlock-0d2d5f2eb0e55b0cc3559b846200d209c5d8a3cd.zip |
try to improve chapters importing
-rw-r--r-- | src/content.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/content.ts b/src/content.ts index 74d9c80c..a30bf3a5 100644 --- a/src/content.ts +++ b/src/content.ts @@ -75,7 +75,6 @@ let sponsorTimes: SponsorTime[] = []; let existingChaptersImported = false; let importingChaptersWaitingForFocus = false; let importingChaptersWaiting = false; -let triedImportingChapters = false; // List of open skip notices const skipNotices: SkipNotice[] = []; let activeSkipKeybindElement: ToggleSkippable = null; @@ -395,7 +394,6 @@ function resetValues() { sponsorTimes = []; existingChaptersImported = false; - triedImportingChapters = false; sponsorSkipped = []; lastResponseStatus = 0; shownSegmentFailedToFetchWarning = false; @@ -1234,7 +1232,7 @@ async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) { } function importExistingChapters(wait: boolean) { - if (!existingChaptersImported && !importingChaptersWaiting && !triedImportingChapters && onVideoPage() && !isOnMobileYouTube()) { + if (!existingChaptersImported && !importingChaptersWaiting && onVideoPage() && !isOnMobileYouTube()) { const waitCondition = () => getVideoDuration() && getExistingChapters(getVideoID(), getVideoDuration()); if (wait && !document.hasFocus() && !importingChaptersWaitingForFocus && !waitCondition()) { @@ -1255,7 +1253,7 @@ function importExistingChapters(wait: boolean) { existingChaptersImported = true; updatePreviewBar(); } - }).catch(() => { importingChaptersWaiting = false; triedImportingChapters = true; }); // eslint-disable-line @typescript-eslint/no-empty-function + }).catch(() => { importingChaptersWaiting = false; }); // eslint-disable-line @typescript-eslint/no-empty-function } } } |