mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-08-23 17:47:26 +00:00
🍱 Refactor bug fix
This commit is contained in:
parent
30f077ba38
commit
86879183b2
1 changed files with 6 additions and 8 deletions
|
@ -139,13 +139,11 @@ window.addEventListener('load', async () =>
|
||||||
if (url.pathname !== '/watch') return
|
if (url.pathname !== '/watch') return
|
||||||
|
|
||||||
const videoId = url.searchParams.get('v')
|
const videoId = url.searchParams.get('v')
|
||||||
if (!videoId) return
|
const lbryPathname = videoId && await requestLbryPathname(videoId)
|
||||||
const lbryPathname = await requestLbryPathname(videoId)
|
if (lbryPathname) target = { lbryPathname, platfrom: targetPlatformSettings[settings.targetPlatform], time: getVideoTime(url) }
|
||||||
if (!lbryPathname) return
|
else target = null
|
||||||
const time = getVideoTime(url)
|
|
||||||
target = { lbryPathname, platfrom: targetPlatformSettings[settings.targetPlatform], time }
|
|
||||||
|
|
||||||
if (settings.redirect) redirectTo(target)
|
if (settings.redirect) target && redirectTo(target)
|
||||||
else updateButton(buttonMountPoint, target)
|
else updateButton(buttonMountPoint, target)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue