mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 15:07:02 +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 {
|
function windowListenerHandler(event: MessageEvent): void {
|
||||||
const data = event.data;
|
const data = event.data;
|
||||||
const dataType = data.type
|
const dataType = data.type;
|
||||||
if (data.source !== "sponsorblock") return;
|
if (data.source !== "sponsorblock") return;
|
||||||
|
|
||||||
if (dataType === "navigation") {
|
if (dataType === "navigation") {
|
||||||
sponsorVideoID = data.videoID;
|
sponsorVideoID = data.videoID;
|
||||||
pageType = data.pageType
|
pageType = data.pageType;
|
||||||
|
|
||||||
|
if (data.channelID) {
|
||||||
channelIDInfo = {
|
channelIDInfo = {
|
||||||
id: data.channelID,
|
id: data.channelID,
|
||||||
status: ChannelIDStatus.Found
|
status: ChannelIDStatus.Found
|
||||||
|
};
|
||||||
}
|
}
|
||||||
} else if (dataType === "ad") {
|
} else if (dataType === "ad") {
|
||||||
if (isAdPlaying != data.playing) {
|
if (isAdPlaying != data.playing) {
|
||||||
|
|||||||
Reference in New Issue
Block a user