Ensure channel id is defined before declaring it found

This commit is contained in:
Ajay
2022-09-02 01:27:01 -04:00
parent 1377be9915
commit 29c6151fe3

View File

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