Skip to content

Commit

Permalink
Fix chapters and unsubmitted segments triggering upcoming notice
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Nov 27, 2024
1 parent 4d86805 commit 38e6d54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,9 @@ async function startSponsorSchedule(includeIntersectingSegments = false, current
currentSkipSchedule = setTimeout(skippingFunction, offsetDelayTime);

// Show the notice only if the segment hasn't already started
if (Config.config.showUpcomingNotice && getCurrentTime() < skippingSegments[0].segment[0]) {
if (Config.config.showUpcomingNotice && getCurrentTime() < skippingSegments[0].segment[0]
&& !sponsorTimesSubmitting?.some((segment) => segment.segment === currentSkip.segment)
&& [ActionType.Skip, ActionType.Mute].includes(skippingSegments[0].actionType)) {
const maxPopupTime = 3000;
const timeUntilPopup = Math.max(0, offsetDelayTime - maxPopupTime);
const popupTime = Math.min(maxPopupTime, timeUntilPopup);
Expand Down

0 comments on commit 38e6d54

Please sign in to comment.