mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 05:57:07 +03:00
Ensure channel id is defined before declaring it found
This commit is contained in:
@@ -2199,15 +2199,18 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
|
||||
|
||||
function windowListenerHandler(event: MessageEvent): void {
|
||||
const data = event.data;
|
||||
const dataType = data.type
|
||||
const dataType = data.type;
|
||||
if (data.source !== "sponsorblock") return;
|
||||
|
||||
if (dataType === "navigation") {
|
||||
sponsorVideoID = data.videoID;
|
||||
pageType = data.pageType
|
||||
channelIDInfo = {
|
||||
id: data.channelID,
|
||||
status: ChannelIDStatus.Found
|
||||
pageType = data.pageType;
|
||||
|
||||
if (data.channelID) {
|
||||
channelIDInfo = {
|
||||
id: data.channelID,
|
||||
status: ChannelIDStatus.Found
|
||||
};
|
||||
}
|
||||
} else if (dataType === "ad") {
|
||||
if (isAdPlaying != data.playing) {
|
||||
|
||||
Reference in New Issue
Block a user