mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
修复播放详情页歌词的一个滚动错误
This commit is contained in:
parent
16f011f63f
commit
00239b669d
@ -1,3 +1,4 @@
|
||||
### 修复
|
||||
|
||||
- 尝试修复软件启动时恢复上一次播放的歌曲可能导致软件崩溃的问题
|
||||
- 修复播放详情页歌词的一个滚动错误
|
||||
|
@ -3,7 +3,6 @@ import { View, Text, StyleSheet, FlatList } from 'react-native'
|
||||
import { useGetter, useDispatch } from '@/store'
|
||||
import { useLayout } from '@/utils/hooks'
|
||||
import { useLrcPlay, useLrcSet } from '@/plugins/lyric'
|
||||
import { screenkeepAwake, screenUnkeepAwake } from '@/utils/utils'
|
||||
|
||||
const LrcLine = memo(({ text, line, activeLine }) => {
|
||||
const theme = useGetter('common', 'theme')
|
||||
@ -62,9 +61,9 @@ export default memo(() => {
|
||||
}
|
||||
|
||||
const handleScrollToIndexFailed = (info) => {
|
||||
console.log(info)
|
||||
// console.log(info)
|
||||
wait.then(() => {
|
||||
scrollTimoutRef.current?.scrollToIndex({ index: info.index, animated: true })
|
||||
scrollViewRef.current?.scrollToIndex({ index: info.index, animated: true })
|
||||
})
|
||||
}
|
||||
|
||||
@ -72,7 +71,7 @@ export default memo(() => {
|
||||
setTimeout(() => {
|
||||
isPauseScrollRef.current = false
|
||||
handleScrollToActive()
|
||||
}, 500)
|
||||
}, 100)
|
||||
return () => {
|
||||
if (scrollTimoutRef.current) {
|
||||
clearTimeout(scrollTimoutRef.current)
|
||||
@ -91,9 +90,7 @@ export default memo(() => {
|
||||
if (isFirstSetLrc.current) {
|
||||
isFirstSetLrc.current = false
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
handleScrollToActive(0)
|
||||
}, 100)
|
||||
handleScrollToActive(0)
|
||||
}
|
||||
}, [handleScrollToActive, lyricLines])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user