diff --git a/publish/changeLog.md b/publish/changeLog.md index eecd5f7..deb53a2 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,3 +1,4 @@ ### 修复 - 尝试修复软件启动时恢复上一次播放的歌曲可能导致软件崩溃的问题 +- 修复播放详情页歌词的一个滚动错误 diff --git a/src/screens/PlayDetail/Portrait/Player/Lyric.js b/src/screens/PlayDetail/Portrait/Player/Lyric.js index b335355..35aac91 100644 --- a/src/screens/PlayDetail/Portrait/Player/Lyric.js +++ b/src/screens/PlayDetail/Portrait/Player/Lyric.js @@ -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])