🍱 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 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)
} }