From 39bf0b13f6e049d1d3fa4c9d735b8f885db38f1d Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 10 Jun 2023 19:59:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=A1=E6=81=AF=E5=8F=AF=E8=83=BD=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/init/dataInit.ts | 4 +++- .../Views/Leaderboard/Vertical/HeaderBar/SourceSelector.tsx | 6 +++--- src/utils/data.ts | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/init/dataInit.ts b/src/core/init/dataInit.ts index 5d7c759..7927e80 100644 --- a/src/core/init/dataInit.ts +++ b/src/core/init/dataInit.ts @@ -4,6 +4,7 @@ import { init as musicSdkInit } from '@/utils/musicSdk' import { getUserLists, setUserList } from '@/core/list' import { setNavActiveId } from '../common' import { getViewPrevState } from '@/utils/data' +import { bootLog } from '@/utils/bootLog' // import { play, playList } from '../player/player' // const initPrevPlayInfo = async(appSetting: LX.AppSetting) => { @@ -23,8 +24,9 @@ export default async(appSetting: LX.AppSetting) => { // initUserApi(), // 自定义API // ]).catch(err => log.error(err)) void musicSdkInit() // 初始化音乐sdk - + bootLog('User list init...') setUserList(await getUserLists()) // 获取用户列表 + bootLog('User list inited.') setNavActiveId((await getViewPrevState()).id) // await initPrevPlayInfo(appSetting).catch(err => log.error(err)) // 初始化上次的歌曲播放信息 } diff --git a/src/screens/Home/Views/Leaderboard/Vertical/HeaderBar/SourceSelector.tsx b/src/screens/Home/Views/Leaderboard/Vertical/HeaderBar/SourceSelector.tsx index 12d869d..929d6d0 100644 --- a/src/screens/Home/Views/Leaderboard/Vertical/HeaderBar/SourceSelector.tsx +++ b/src/screens/Home/Views/Leaderboard/Vertical/HeaderBar/SourceSelector.tsx @@ -6,7 +6,7 @@ import SourceSelector, { type SourceSelectorType as _SourceSelectorType, type SourceSelectorProps as _SourceSelectorProps, } from '@/components/SourceSelector' -import songlistState, { type Source, type InitState } from '@/store/leaderboard/state' +import leaderboardState, { type Source, type InitState } from '@/store/leaderboard/state' type Sources = Readonly type SourceSelectorCommonProps = _SourceSelectorProps @@ -26,13 +26,13 @@ export default forwardRef(({ style, onS useImperativeHandle(ref, () => ({ setSource(source) { - sourceSelectorRef.current?.setSourceList(songlistState.sources, source) + sourceSelectorRef.current?.setSourceList(leaderboardState.sources, source) }, }), []) return ( - (styles.selector, style)}> + (styles.selector, style)}> ) diff --git a/src/utils/data.ts b/src/utils/data.ts index d7055f7..1ee0490 100644 --- a/src/utils/data.ts +++ b/src/utils/data.ts @@ -235,7 +235,7 @@ export const getUserLists = async(): Promise => { const list = await getData(userListKey) ?? [] for (const info of list) { // 兼容v2.3.0之前版本PC端插入数字类型的ID导致其意外在末尾追加 .0 的问题 - if (info.sourceListId?.endsWith('.0')) { + if (info.sourceListId?.endsWith?.('.0')) { info.sourceListId = info.sourceListId.replace(idFixRxp, '') } }