mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-09-20 04:53:43 +02:00
Don't show duplicate skip notices
This commit is contained in:
parent
dd447297f9
commit
0c216792cf
1 changed files with 8 additions and 0 deletions
|
@ -1377,6 +1377,14 @@ function skipToTime({v, skipTime, skippingSegments, openNotice, forceAutoSkip, u
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSkipNotice(skippingSegments: SponsorTime[], autoSkip: boolean, unskipTime: number, startReskip: boolean) {
|
function createSkipNotice(skippingSegments: SponsorTime[], autoSkip: boolean, unskipTime: number, startReskip: boolean) {
|
||||||
|
for (const skipNotice of skipNotices) {
|
||||||
|
if (skippingSegments.length === skipNotice.segments.length
|
||||||
|
&& skippingSegments.every((segment) => skipNotice.segments.some((s) => s.UUID === segment.UUID))) {
|
||||||
|
// Skip notice already exists
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const newSkipNotice = new SkipNotice(skippingSegments, autoSkip, skipNoticeContentContainer, unskipTime, startReskip);
|
const newSkipNotice = new SkipNotice(skippingSegments, autoSkip, skipNoticeContentContainer, unskipTime, startReskip);
|
||||||
if (onMobileYouTube || Config.config.skipKeybind == null) newSkipNotice.setShowKeybindHint(false);
|
if (onMobileYouTube || Config.config.skipKeybind == null) newSkipNotice.setShowKeybindHint(false);
|
||||||
skipNotices.push(newSkipNotice);
|
skipNotices.push(newSkipNotice);
|
||||||
|
|
Loading…
Reference in a new issue