mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-05 20:08:55 +08:00
修复竖屏下排行榜列表名字显示问题
This commit is contained in:
parent
8ea63a2784
commit
666adc6a57
@ -31,20 +31,6 @@ export default () => {
|
|||||||
const boundInfo = useRef<{ source: LX.OnlineSource, id: string | null }>({ source: 'kw', id: null })
|
const boundInfo = useRef<{ source: LX.OnlineSource, id: string | null }>({ source: 'kw', id: null })
|
||||||
// const [width, setWidth] = useState(0)
|
// const [width, setWidth] = useState(0)
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const handleFixDrawer = (id: CommonState['navActiveId']) => {
|
|
||||||
if (id == 'nav_top') drawer.current?.fixWidth()
|
|
||||||
}
|
|
||||||
// setWidth(getWindowSise().width * 0.82)
|
|
||||||
|
|
||||||
global.state_event.on('navActiveIdUpdated', handleFixDrawer)
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
global.state_event.off('navActiveIdUpdated', handleFixDrawer)
|
|
||||||
// changeEvent.remove()
|
|
||||||
}
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const handleBoundChange = (source: LX.OnlineSource, id: string) => {
|
const handleBoundChange = (source: LX.OnlineSource, id: string) => {
|
||||||
musicListRef.current?.loadList(source, id)
|
musicListRef.current?.loadList(source, id)
|
||||||
void saveLeaderboardSetting({
|
void saveLeaderboardSetting({
|
||||||
@ -108,8 +94,16 @@ export default () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const handleFixDrawer = (id: CommonState['navActiveId']) => {
|
||||||
|
if (id == 'nav_top') drawer.current?.fixWidth()
|
||||||
|
}
|
||||||
|
global.state_event.on('navActiveIdUpdated', handleFixDrawer)
|
||||||
|
|
||||||
|
|
||||||
isUnmountedRef.current = false
|
isUnmountedRef.current = false
|
||||||
void getLeaderboardSetting().then(({ source, boardId }) => {
|
void getLeaderboardSetting().then(({ source, boardId }) => {
|
||||||
|
boundInfo.current.source = source
|
||||||
|
boundInfo.current.id = boardId
|
||||||
void getBoardsList(source).then(list => {
|
void getBoardsList(source).then(list => {
|
||||||
const bound = list.find(l => l.id == boardId)
|
const bound = list.find(l => l.id == boardId)
|
||||||
boardsListRef.current?.setList(list, boardId)
|
boardsListRef.current?.setList(list, boardId)
|
||||||
@ -119,6 +113,7 @@ export default () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
global.state_event.off('navActiveIdUpdated', handleFixDrawer)
|
||||||
isUnmountedRef.current = true
|
isUnmountedRef.current = true
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user