Skip to content

Commit

Permalink
Wait for skip button control bar to be setup before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Nov 28, 2024
1 parent 4e5ddd0 commit 46b8c41
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1766,11 +1766,13 @@ function skipToTime({v, skipTime, skippingSegments, openNotice, forceAutoSkip, u
if (!autoSkip
&& skippingSegments.length === 1
&& skippingSegments[0].actionType === ActionType.Poi) {
skipButtonControlBar.enable(skippingSegments[0]);
if (isOnMobileYouTube() || Config.config.skipKeybind == null) skipButtonControlBar.setShowKeybindHint(false);

activeSkipKeybindElement?.setShowKeybindHint(false);
activeSkipKeybindElement = skipButtonControlBar;
waitFor(() => skipButtonControlBar).then(() => {
skipButtonControlBar.enable(skippingSegments[0]);
if (isOnMobileYouTube() || Config.config.skipKeybind == null) skipButtonControlBar.setShowKeybindHint(false);

activeSkipKeybindElement?.setShowKeybindHint(false);
activeSkipKeybindElement = skipButtonControlBar;
})
} else {
if (openNotice) {
//send out the message saying that a sponsor message was skipped
Expand Down

0 comments on commit 46b8c41

Please sign in to comment.