Skip to content

Commit

Permalink
Fix incorrect setlist (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
themintchoco authored Mar 12, 2023
1 parent 85524c1 commit 42a1b99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ chrome.runtime.onMessage.addListener(async (message: BrowserMessage, sender) =>
switch (message.type) {
case BrowserMessageType.tabStatusChange:
if (message.status !== 'complete' || videoId === newVideoId) return
videoId = newVideoId
break
case BrowserMessageType.languageChanged:
void i18n.changeLanguage()
Expand All @@ -53,6 +54,9 @@ chrome.runtime.onMessage.addListener(async (message: BrowserMessage, sender) =>
return
}

root.render(<></>)
if (!videoId) return

const player = await ensureSelector('.ytd-player') as HTMLElement
const channelId = await getChannelId()

Expand All @@ -65,6 +69,4 @@ chrome.runtime.onMessage.addListener(async (message: BrowserMessage, sender) =>
dexLinkContainer={linkContainer}
/>
)

videoId = newVideoId
})

0 comments on commit 42a1b99

Please sign in to comment.