From 2c32e71cbdbcaff153e023a3bf8da6031ba993e1 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 20 Oct 2023 14:51:03 +0800 Subject: [PATCH] fix: song data destruction --- src/components/widgets/Player/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/widgets/Player/index.tsx b/src/components/widgets/Player/index.tsx index 3ee0e9017..52a84199b 100644 --- a/src/components/widgets/Player/index.tsx +++ b/src/components/widgets/Player/index.tsx @@ -79,12 +79,14 @@ export const MusicMiniPlayer = forwardRef< ) const json = (await response.json()) as MetingPayloadType[] - const [data] = await apiClient.serverless.proxy.kami.song.get({ + let data = await apiClient.serverless.proxy.kami.song.get({ params: { id, }, }) + data = data[0] + const songUrl = data.url?.replace('http://', 'https://') setCur({ ...data, ...json[0], id, url: songUrl }) } @@ -266,6 +268,7 @@ export const MusicMiniPlayer = forwardRef< ) }) +MusicMiniPlayer.displayName = 'MusicMiniPlayer' const BottomProgressBar = memo(() => { const playProgress = usePlayProgress() @@ -292,6 +295,7 @@ const BottomProgressBar = memo(() => { ) }) +BottomProgressBar.displayName = 'BottomProgressBar' const changeOfPlayerHandler = throttle( (id, time, totalTime) => { useMusicStore.getState().setPlayInfo(id, time, totalTime) @@ -363,6 +367,8 @@ export const _MusicMiniPlayerStoreControlled = memo(() => { ) }) +_MusicMiniPlayerStoreControlled.displayName = 'MusicMiniPlayerStoreControlled' + export const MusicMiniPlayerStoreControlled = withNoSSR( _MusicMiniPlayerStoreControlled, )