优化代码逻辑,修复潜在播放问题

This commit is contained in:
lyswhut
2023-01-14 16:03:56 +08:00
parent d3c8f16aed
commit 850a429243
35 changed files with 85 additions and 342 deletions
+2 -2
View File
@@ -113,7 +113,7 @@ export const updateSetting = (setting?: Partial<LX.AppSetting>, isInit: boolean
let originSetting: LX.AppSetting
if (isInit) {
if (setting) setting = migrateSetting(setting)
setting &&= migrateSetting(setting)
originSetting = { ...defaultSetting }
} else originSetting = global.lx.appSetting
@@ -196,7 +196,7 @@ export const openDevTools = (webContents: Electron.WebContents) => {
let userThemes: LX.Theme[]
export const getAllThemes = () => {
if (!userThemes) userThemes = getStore(STORE_NAMES.THEME).get('themes') as LX.Theme[] | null ?? []
userThemes ??= getStore(STORE_NAMES.THEME).get('themes') as (LX.Theme[] | null) ?? []
return {
themes,
userThemes,