mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
fix: bugs
This commit is contained in:
parent
bc696ca59f
commit
b1fd51233a
5 changed files with 22 additions and 17 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
State as PlayerState,
|
||||
Mode as PlayerMode,
|
||||
} from '@/renderer/utils/player'
|
||||
import useCoverColor from '../hooks/useCoverColor'
|
||||
|
||||
const MediaControls = () => {
|
||||
const classes =
|
||||
|
|
@ -59,7 +60,6 @@ const MediaControls = () => {
|
|||
|
||||
const FMCard = () => {
|
||||
const navigate = useNavigate()
|
||||
const [bgColor, setBgColor] = useState({ from: '#222', to: '#222' })
|
||||
|
||||
const playerSnapshot = useSnapshot(player)
|
||||
const track = useMemo(() => playerSnapshot.fmTrack, [playerSnapshot.fmTrack])
|
||||
|
|
@ -68,13 +68,7 @@ const FMCard = () => {
|
|||
[track?.al?.picUrl]
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
getCoverColor(track?.al?.picUrl || '').then(color => {
|
||||
if (!color) return
|
||||
const to = colord(color).darken(0.15).rotate(-5).toHex()
|
||||
setBgColor({ from: color, to })
|
||||
})
|
||||
}, [track?.al?.picUrl])
|
||||
const bgColor = useCoverColor(track?.al?.picUrl ?? '')
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue