Skip to content

Commit

Permalink
fix: song data destruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Oct 20, 2023
1 parent 09b9f0f commit 2c32e71
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/widgets/Player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ export const MusicMiniPlayer = forwardRef<
)
const json = (await response.json()) as MetingPayloadType[]

const [data] = await apiClient.serverless.proxy.kami.song.get<any>({
let data = await apiClient.serverless.proxy.kami.song.get<any>({
params: {
id,
},
})

data = data[0]

const songUrl = data.url?.replace('http://', 'https://')
setCur({ ...data, ...json[0], id, url: songUrl })
}
Expand Down Expand Up @@ -266,6 +268,7 @@ export const MusicMiniPlayer = forwardRef<
</div>
)
})
MusicMiniPlayer.displayName = 'MusicMiniPlayer'

const BottomProgressBar = memo(() => {
const playProgress = usePlayProgress()
Expand All @@ -292,6 +295,7 @@ const BottomProgressBar = memo(() => {
)
})

BottomProgressBar.displayName = 'BottomProgressBar'
const changeOfPlayerHandler = throttle(
(id, time, totalTime) => {
useMusicStore.getState().setPlayInfo(id, time, totalTime)
Expand Down Expand Up @@ -363,6 +367,8 @@ export const _MusicMiniPlayerStoreControlled = memo(() => {
)
})

_MusicMiniPlayerStoreControlled.displayName = 'MusicMiniPlayerStoreControlled'

export const MusicMiniPlayerStoreControlled = withNoSSR(
_MusicMiniPlayerStoreControlled,
)

0 comments on commit 2c32e71

Please sign in to comment.