Wait for skip button control bar to be setup before using it

This commit is contained in:
Ajay
2024-11-28 10:20:42 -05:00
parent 4e5ddd07c9
commit 46b8c41db7

View File

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