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 { useGetter, useDispatch } from '@/store'
|
||||||
import { useLayout } from '@/utils/hooks'
|
import { useLayout } from '@/utils/hooks'
|
||||||
import { useLrcPlay, useLrcSet } from '@/plugins/lyric'
|
import { useLrcPlay, useLrcSet } from '@/plugins/lyric'
|
||||||
import { screenkeepAwake, screenUnkeepAwake } from '@/utils/utils'
|
|
||||||
|
|
||||||
const LrcLine = memo(({ text, line, activeLine }) => {
|
const LrcLine = memo(({ text, line, activeLine }) => {
|
||||||
const theme = useGetter('common', 'theme')
|
const theme = useGetter('common', 'theme')
|
||||||
@ -62,9 +61,9 @@ export default memo(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleScrollToIndexFailed = (info) => {
|
const handleScrollToIndexFailed = (info) => {
|
||||||
console.log(info)
|
// console.log(info)
|
||||||
wait.then(() => {
|
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(() => {
|
setTimeout(() => {
|
||||||
isPauseScrollRef.current = false
|
isPauseScrollRef.current = false
|
||||||
handleScrollToActive()
|
handleScrollToActive()
|
||||||
}, 500)
|
}, 100)
|
||||||
return () => {
|
return () => {
|
||||||
if (scrollTimoutRef.current) {
|
if (scrollTimoutRef.current) {
|
||||||
clearTimeout(scrollTimoutRef.current)
|
clearTimeout(scrollTimoutRef.current)
|
||||||
@ -91,9 +90,7 @@ export default memo(() => {
|
|||||||
if (isFirstSetLrc.current) {
|
if (isFirstSetLrc.current) {
|
||||||
isFirstSetLrc.current = false
|
isFirstSetLrc.current = false
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
|
||||||
handleScrollToActive(0)
|
handleScrollToActive(0)
|
||||||
}, 100)
|
|
||||||
}
|
}
|
||||||
}, [handleScrollToActive, lyricLines])
|
}, [handleScrollToActive, lyricLines])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user