From 797fbf563b1cd851ec950801f158c63af61117d3 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 26 Apr 2020 21:46:38 -0400 Subject: [PATCH] Fix start sponsor code not functioning as well as it should have --- src/content.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content.ts b/src/content.ts index 41398467..83df8952 100644 --- a/src/content.ts +++ b/src/content.ts @@ -641,12 +641,12 @@ function sponsorsLookup(id: string) { // See if there are any starting sponsors let startingSponsor: number = -1; for (const time of sponsorTimes) { - if (time[0] <= video.currentTime && time.segment[0] > startingSponsor && time.segment[1] > video.currentTime) { + if (time.segment[0] <= video.currentTime && time.segment[0] > startingSponsor && time.segment[1] > video.currentTime) { startingSponsor = time.segment[0]; break; } } - if (!startingSponsor) { + if (startingSponsor === -1) { for (const time of sponsorTimesSubmitting) { if (time.segment[0] <= video.currentTime && time.segment[0] > startingSponsor && time.segment[1] > video.currentTime) { startingSponsor = time.segment[0];