aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/content.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/content.ts')
-rw-r--r--src/content.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/content.ts b/src/content.ts
index de537005..03afcb16 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -302,8 +302,7 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
reskipSponsorTime(sponsorTimes.find((segment) => segment.UUID === request.UUID), true);
break;
case "selectSegment":
- selectedSegment = request.UUID;
- updatePreviewBar();
+ selectSegment(request.UUID);
break;
case "submitVote":
vote(request.type, request.UUID).then((response) => sendResponse(response));
@@ -1071,6 +1070,7 @@ function setupSkipButtonControlBar() {
openNotice: true,
forceAutoSkip: true
}),
+ selectSegment,
onMobileYouTube: isOnMobileYouTube()
});
}
@@ -1349,6 +1349,11 @@ function updatePreviewBarPositionMobile(parent: HTMLElement) {
}
}
+function selectSegment(UUID: SegmentUUID): void {
+ selectedSegment = UUID;
+ updatePreviewBar();
+}
+
function updatePreviewBar(): void {
if (previewBar === null) return;