mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 13:37:04 +03:00
Fixed preview bar sometimes not appearing
This commit is contained in:
@@ -810,6 +810,8 @@ function updatePreviewBarPositionMobile(parent: Element) {
|
||||
}
|
||||
|
||||
function updatePreviewBar() {
|
||||
if (previewBar === null || video === null) return;
|
||||
|
||||
let localSponsorTimes = sponsorTimes;
|
||||
if (localSponsorTimes == null) localSponsorTimes = [];
|
||||
|
||||
@@ -829,8 +831,7 @@ function updatePreviewBar() {
|
||||
types.push("preview-" + sponsorTimesSubmitting[i].category);
|
||||
}
|
||||
|
||||
utils.wait(() => previewBar !== null && video !== null)
|
||||
.then((result) => previewBar.set(utils.getSegmentsFromSponsorTimes(allSponsorTimes), types, video.duration));
|
||||
previewBar.set(utils.getSegmentsFromSponsorTimes(allSponsorTimes), types, video.duration)
|
||||
|
||||
//update last video id
|
||||
lastPreviewBarUpdate = sponsorVideoID;
|
||||
|
||||
Reference in New Issue
Block a user