优化代码

pull/2077/head
lyswhut 2024-06-19 19:25:21 +08:00
parent 96ddbdf0f0
commit 19f81cf379
5 changed files with 15 additions and 18 deletions

View File

@ -106,18 +106,17 @@ const macOptions = {
}, },
dmg: { dmg: {
window: { window: {
width: 600, width: 530,
height: 400, height: 380,
}, },
contents: [ contents: [
{ {
x: 106, x: 140,
y: 252, y: 200,
name: 'LX Music',
}, },
{ {
x: 490, x: 390,
y: 252, y: 200,
type: 'link', type: 'link',
path: '/Applications', path: '/Applications',
}, },

View File

@ -101,7 +101,7 @@ export default () => {
const rSetConfig = onSettingChanged(({ params: setting }) => { const rSetConfig = onSettingChanged(({ params: setting }) => {
// console.log(config) // console.log(config)
mergeSetting(setting) mergeSetting(setting)
window.app_event.configUpdate() window.app_event.configUpdate(setting)
}) })
const rFocus = onFocus(() => { const rFocus = onFocus(() => {

View File

@ -20,11 +20,7 @@ export default () => {
openAPI.address = '' openAPI.address = ''
openAPI.message = error.message openAPI.message = error.message
}).finally(() => { }).finally(() => {
if (openAPI.address) { setDisableAutoPauseBySource(!!openAPI.address, 'openAPI')
setDisableAutoPauseBySource(true, 'openAPI')
} else {
setDisableAutoPauseBySource(false, 'openAPI')
}
}) })
} }
watch(() => appSetting['openAPI.enable'], enable => { watch(() => appSetting['openAPI.enable'], enable => {

View File

@ -1,4 +1,3 @@
import { watch } from '@common/utils/vueTools'
import { appSetting } from '@renderer/store/setting' import { appSetting } from '@renderer/store/setting'
import { setDisableAutoPauseBySource } from '@renderer/core/lyric' import { setDisableAutoPauseBySource } from '@renderer/core/lyric'
@ -6,8 +5,11 @@ export default () => {
const handleEnable = (enable: boolean) => { const handleEnable = (enable: boolean) => {
setDisableAutoPauseBySource(enable, 'statusBarLyric') setDisableAutoPauseBySource(enable, 'statusBarLyric')
} }
watch(() => appSetting['player.isShowStatusBarLyric'], enable => {
handleEnable(enable) window.app_event.on('configUpdate', (setting) => {
if (setting['player.isShowStatusBarLyric'] != null) {
handleEnable(setting['player.isShowStatusBarLyric'])
}
}) })
return async() => { return async() => {

View File

@ -11,8 +11,8 @@ import Event from './Event'
// } // }
export class AppEvent extends Event { export class AppEvent extends Event {
configUpdate() { configUpdate(setting: Partial<LX.AppSetting>) {
this.emit('configUpdate') this.emit('configUpdate', setting)
} }
focus() { focus() {