mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 17:37:21 +00:00
Deextract prepareVM
This commit is contained in:
parent
0474e0355e
commit
58235e18fb
5 changed files with 56 additions and 43 deletions
|
|
@ -3,11 +3,17 @@ import { useState, useEffect } from 'preact/hooks'
|
|||
|
||||
import UrlPlayer from '~/src/components/player/UrlPlayer'
|
||||
|
||||
export default function ({setTheme, theme, encodedUrl}) {
|
||||
const [url] = useState(decodeURIComponent(encodedUrl))
|
||||
const decode = encodedUrl => decodeURIComponent(encodedUrl)
|
||||
|
||||
export default function ({setTheme, theme, encodedUrl}) {
|
||||
useEffect(() => setTheme(theme), [theme])
|
||||
|
||||
const [url, setUrl] = useState(decode(encodedUrl))
|
||||
|
||||
useEffect(() => {
|
||||
setUrl(decode(encodedUrl))
|
||||
}, [encodedUrl])
|
||||
|
||||
return (
|
||||
<main>
|
||||
<UrlPlayer url={url} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue