diff options
-rw-r--r-- | src/content.ts | 8 | ||||
-rw-r--r-- | src/js-components/skipButtonControlBar.ts | 4 | ||||
-rw-r--r-- | src/popup.ts | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts index 6b87ddd9..8bc1cd2f 100644 --- a/src/content.ts +++ b/src/content.ts @@ -259,6 +259,11 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo utils.getSponsorTimeFromUUID(sponsorTimes, request.UUID).hidden = request.type; utils.addHiddenSegment(sponsorVideoID, request.UUID, request.type); updatePreviewBar(); + + if (skipButtonControlBar?.isEnabled() + && sponsorTimesSubmitting.every((s) => s.hidden !== SponsorHideType.Visible || s.actionType !== ActionType.Poi)) { + skipButtonControlBar.disable(); + } break; case "closePopup": closeInfoMenu(); @@ -1229,7 +1234,8 @@ function startSkipScheduleCheckingForStartSponsors() { // For highlight category const poiSegments = sponsorTimes - .filter((time) => time.segment[1] > video.currentTime && time.actionType === ActionType.Poi) + .filter((time) => time.segment[1] > video.currentTime + && time.actionType === ActionType.Poi && time.hidden === SponsorHideType.Visible) .sort((a, b) => b.segment[0] - a.segment[0]); for (const time of poiSegments) { const skipOption = utils.getCategorySelection(time.category)?.option; diff --git a/src/js-components/skipButtonControlBar.ts b/src/js-components/skipButtonControlBar.ts index 11bbf1ac..7ab86bc9 100644 --- a/src/js-components/skipButtonControlBar.ts +++ b/src/js-components/skipButtonControlBar.ts @@ -142,6 +142,10 @@ export class SkipButtonControlBar { this.enabled = false; } + isEnabled(): boolean { + return this.enabled; + } + toggleSkip(): void { this.skip(this.segment); this.disableText(); diff --git a/src/popup.ts b/src/popup.ts index d24721b0..526b6381 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -698,6 +698,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> { voteButtonsContainer.appendChild(downvoteButton); voteButtonsContainer.appendChild(uuidButton); if (downloadedTimes[i].actionType === ActionType.Skip || downloadedTimes[i].actionType === ActionType.Mute + || downloadedTimes[i].actionType === ActionType.Poi && [SponsorHideType.Visible, SponsorHideType.Hidden].includes(downloadedTimes[i].hidden)) { voteButtonsContainer.appendChild(hideButton); } |