Fix chapters and unsubmitted segments triggering upcoming notice

This commit is contained in:
Ajay
2024-11-27 12:56:24 -05:00
parent 4d868055e7
commit 38e6d5469f

View File

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