🍱 Refactor bug fix

This commit is contained in:
Shiba 2022-01-09 23:17:20 +00:00
parent 30f077ba38
commit 86879183b2

View file

@ -139,13 +139,11 @@ window.addEventListener('load', async () =>
if (url.pathname !== '/watch') return
const videoId = url.searchParams.get('v')
if (!videoId) return
const lbryPathname = await requestLbryPathname(videoId)
if (!lbryPathname) return
const time = getVideoTime(url)
target = { lbryPathname, platfrom: targetPlatformSettings[settings.targetPlatform], time }
const lbryPathname = videoId && await requestLbryPathname(videoId)
if (lbryPathname) target = { lbryPathname, platfrom: targetPlatformSettings[settings.targetPlatform], time: getVideoTime(url) }
else target = null
if (settings.redirect) redirectTo(target)
if (settings.redirect) target && redirectTo(target)
else updateButton(buttonMountPoint, target)
}