添加针对进入歌词界面时歌词滚动错误弹窗的处理

This commit is contained in:
lyswhut 2021-07-22 09:49:58 +08:00
parent fea0545b16
commit 48bfcd505d
2 changed files with 12 additions and 10 deletions

View File

@ -5,4 +5,5 @@
### 修复
- 修复单曲循环播放时循环次数为偶数时歌词不重新播放的问题
- 添加针对进入歌词界面时某些情况下会弹出`scrollToIndex out of range: requested index ...`崩溃错误弹窗的处理
- 修复导入kg歌单最多只能加载100、500首歌曲的问题。注现在可以加载1000+首歌曲的歌单但出于未知原因会导致部分歌曲无法加载可能是无版权导致的目前酷狗码仍然最多只能加载500首歌

View File

@ -52,16 +52,17 @@ export default memo(() => {
const handleScrollToActive = useCallback((index = lineRef.current) => {
if (index < 0) return
if (scrollViewRef.current) {
// try {
scrollViewRef.current.scrollToIndex({
index: index,
animated: true,
viewPosition: 0.4,
})
// } catch (err) {
// toast('出了点意外...你可以去错误日志查看错误', 'long')
// log.warn('Scroll failed: ', err.message)
// }
try {
scrollViewRef.current.scrollToIndex({
index,
animated: true,
viewPosition: 0.4,
})
} catch (err) {
console.log(err)
// toast('出了点意外...你可以去错误日志查看错误', 'long')
// log.warn('Scroll failed: ', err.message)
}
}
}, [])