修复备份与恢复功能在恢复数据时某些设置不立即生效的问题

This commit is contained in:
lyswhut
2021-03-12 16:22:22 +08:00
parent 68d8369a8b
commit 08d0758616
15 changed files with 71 additions and 44 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ const { common: COMMON_EVENT_NAME, winLyric: WIN_LYRIC_EVENT_NAME, hotKey: HOT_K
const { mainSend, NAMES: { winLyric: ipcWinLyricNames } } = require('../../../common/ipc')
const { desktop_lyric } = require('../../../common/hotKey')
const { getLyricWindowBounds } = require('./utils')
const { updateSetting } = require('../../utils')
let isLock = null
let isEnable = null
@@ -49,7 +50,7 @@ const setLrcConfig = () => {
}
}
}
global.lx_event.common.on(COMMON_EVENT_NAME.config, name => {
global.lx_event.common.on(COMMON_EVENT_NAME.configStatus, name => {
if (WIN_LYRIC_EVENT_NAME.name === name) return
setLrcConfig()
})
@@ -77,5 +78,5 @@ global.lx_event.hotKey.on(HOT_KEY_EVENT_NAME.keyDown, ({ type, key }) => {
}
desktopLyricSetting[settingKey] = !desktopLyricSetting[settingKey]
global.lx_event.common.setAppConfig({ desktopLyric: desktopLyricSetting }, null)
updateSetting({ desktopLyric: desktopLyricSetting }, null)
})
+1 -1
View File
@@ -21,7 +21,7 @@ const setLyricsConfig = debounce(config => {
// if (y != null) bounds.y = y
// if (width != null) bounds.width = width
// if (height != null) bounds.height = height
global.lx_event.common.setAppConfig({ desktopLyric: config }, WIN_LYRIC_EVENT_NAME.name)
global.lx_core.setAppConfig({ desktopLyric: config }, WIN_LYRIC_EVENT_NAME.name)
}, 500)
const winEvent = lyricWindow => {
+1 -1
View File
@@ -20,7 +20,7 @@ mainOn(ipcWinLyricNames.get_lyric_info, (event, action) => {
})
mainOn(ipcWinLyricNames.set_lyric_config, (event, config) => {
global.lx_event.common.setAppConfig({ desktopLyric: config }, WIN_LYRIC_EVENT_NAME.name)
global.lx_core.setAppConfig({ desktopLyric: config }, WIN_LYRIC_EVENT_NAME.name)
})
mainHandle(ipcWinLyricNames.get_lyric_config, async() => {