mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-03 09:12:09 +08:00
修复内置列表名称硬编码的问题(#662)
This commit is contained in:
parent
47d4088c3e
commit
5302e7b892
@ -49,6 +49,8 @@
|
||||
"ignoring_battery_optimization_check_tip": "LX Music is not on the list of ignored battery optimization, which may cause the problem of being suspended by the system when playing music in the background. Do you want to add LX Music to the whitelist?",
|
||||
"ignoring_battery_optimization_check_title": "Background running permission setting reminder",
|
||||
"input_error": "Don't input indiscriminately 😡",
|
||||
"list_name_default": "Default",
|
||||
"list_name_love": "Loved",
|
||||
"list_add_btn_title": "Add the song(s) to {name}",
|
||||
"list_add_tip_exists": "This song already exists in the list, don't click me again~😡",
|
||||
"list_add_title_first_add": "Add",
|
||||
|
@ -49,6 +49,8 @@
|
||||
"ignoring_battery_optimization_check_tip": "LX Music 没有在「忽略电池优化」的白名单中,这可能会导致在后台播放音乐时被系统暂停。是否将 LX Music 加入该白名单中?",
|
||||
"ignoring_battery_optimization_check_title": "后台运行权限设置提醒",
|
||||
"input_error": "不要乱输好吧😡",
|
||||
"list_name_default": "试听列表",
|
||||
"list_name_love": "我的收藏",
|
||||
"list_add_btn_title": "把该歌曲添加到「{name}」",
|
||||
"list_add_tip_exists": "列表已经存在这首歌啦,不要再点我啦~😡",
|
||||
"list_add_title_first_add": "添加",
|
||||
|
@ -4,11 +4,23 @@ import { getListMusics } from '@/core/list'
|
||||
|
||||
export const useMyList = () => {
|
||||
const [lists, setList] = useState(state.allList)
|
||||
lists[0].name = global.i18n.t('list_name_default')
|
||||
lists[1].name = global.i18n.t('list_name_love')
|
||||
|
||||
useEffect(() => {
|
||||
const handleConfigUpdate = (keys: Array<keyof LX.AppSetting>) => {
|
||||
if (!keys.includes('common.langId')) return
|
||||
setList((lists) => {
|
||||
lists[0].name = global.i18n.t('list_name_default')
|
||||
lists[1].name = global.i18n.t('list_name_love')
|
||||
return [...lists]
|
||||
})
|
||||
}
|
||||
global.state_event.on('mylistUpdated', setList)
|
||||
global.state_event.on('configUpdated', handleConfigUpdate)
|
||||
return () => {
|
||||
global.state_event.off('mylistUpdated', setList)
|
||||
global.state_event.off('configUpdated', handleConfigUpdate)
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user