diff --git a/publish/changeLog.md b/publish/changeLog.md index f0bc6d1..866e37c 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,9 +1,3 @@ -### 优化 - -- 缓冲进度条颜色 -- 优化数据存储,若需要存储的数据过大时会将数据切片后存储,现在存储大列表不会导致列表丢失了 - ### 修复 -- 修复随机播放模式下在同列表切其他歌曲不会清空已播放列表的问题 -- 修复歌曲播放出错时的URL刷新问题 +- 修复我的列表搜索输入某些字符会导致应用崩溃的问题 diff --git a/src/screens/Home/List/utils.js b/src/screens/Home/List/utils.js index 26648cd..fa023f7 100644 --- a/src/screens/Home/List/utils.js +++ b/src/screens/Home/List/utils.js @@ -65,7 +65,7 @@ const handleSortList = (list, keyword) => { export const debounceSearchList = debounce((text, list, callback) => { const reslutList = [] if (!text.length) return - let rxp = new RegExp(text.split('').join('.*') + '.*', 'i') + let rxp = new RegExp(text.split('').map(s => s.replace(/[.*+?^${}()|[\]\\]/, '\\$&')).join('.*') + '.*', 'i') for (const item of list) { if (rxp.test(`${item.name}${item.singer}${item.albumName ? item.albumName : ''}`)) reslutList.push(item) }