修复界面不可见时状态栏歌词没有更新的问题

This commit is contained in:
lyswhut
2024-06-19 12:39:44 +08:00
parent b0881726fa
commit 9eb87911a6
6 changed files with 43 additions and 12 deletions
@@ -0,0 +1,18 @@
import { watch } from '@common/utils/vueTools'
import { appSetting } from '@renderer/store/setting'
import { setDisableAutoPauseBySource } from '@renderer/core/lyric'
export default () => {
const handleEnable = (enable: boolean) => {
setDisableAutoPauseBySource(enable, 'statusBarLyric')
}
watch(() => appSetting['player.isShowStatusBarLyric'], enable => {
handleEnable(enable)
})
return async() => {
if (appSetting['player.isShowStatusBarLyric']) {
handleEnable(true)
}
}
}