升级到 vue3
This commit is contained in:
+2
-2
@@ -38,7 +38,7 @@ if (process.platform == 'linux') app.commandLine.appendSwitch('use-gl', 'desktop
|
||||
app.commandLine.appendSwitch('wm-window-animations-disabled')
|
||||
|
||||
|
||||
const { navigationUrlWhiteList } = require('../common/config')
|
||||
const { navigationUrlWhiteList, themes } = require('../common/config')
|
||||
const { getWindowSizeInfo, initSetting, updateSetting } = require('./utils')
|
||||
const { isMac, isLinux, initHotKey } = require('../common/utils')
|
||||
|
||||
@@ -121,7 +121,7 @@ function createWindow() {
|
||||
},
|
||||
})
|
||||
|
||||
global.modules.mainWindow.loadURL(winURL)
|
||||
global.modules.mainWindow.loadURL(winURL + `?dt=${!!global.envParams.cmdParams.dt}&theme=${themes.find(t => t.id == global.appSetting.themeId)?.className ?? themes[0].className}`)
|
||||
|
||||
winEvent(global.modules.mainWindow)
|
||||
// global.modules.mainWindow.webContents.openDevTools()
|
||||
|
||||
@@ -20,6 +20,7 @@ require('./data')
|
||||
require('./lyric')
|
||||
require('./musicUrl')
|
||||
require('./systemFonts')
|
||||
require('./wait')
|
||||
|
||||
// require('./kw_decodeLyric')
|
||||
|
||||
|
||||
@@ -8,16 +8,18 @@ mainHandle(ipcMainWindowNames.get_playlist, async(event, isIgnoredError = false)
|
||||
return {
|
||||
defaultList: electronStore_list.get('defaultList'),
|
||||
loveList: electronStore_list.get('loveList'),
|
||||
tempList: electronStore_list.get('tempList'),
|
||||
userList: electronStore_list.get('userList'),
|
||||
downloadList: getStore('downloadList').get('list'),
|
||||
}
|
||||
})
|
||||
|
||||
const handleSaveList = ({ defaultList, loveList, userList }) => {
|
||||
const handleSaveList = ({ defaultList, loveList, userList, tempList }) => {
|
||||
let data = {}
|
||||
if (defaultList != null) data.defaultList = defaultList
|
||||
if (loveList != null) data.loveList = loveList
|
||||
if (userList != null) data.userList = userList
|
||||
if (tempList != null) data.tempList = tempList
|
||||
getStore('playList').set(data)
|
||||
}
|
||||
mainOn(ipcMainWindowNames.save_playlist, (event, { type, data }) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { mainOn, mainSend, NAMES: { mainWindow: ipcMainWindowNames } } = require('../../common/ipc')
|
||||
const { mainOn, mainSend, NAMES: { mainWindow: ipcMainWindowNames } } = require('@common/ipc')
|
||||
|
||||
|
||||
mainOn(ipcMainWindowNames.set_lyric_info, (event, info) => {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
const { mainOn, mainHandle, NAMES: { mainWindow: ipcMainWindowNames } } = require('@common/ipc')
|
||||
|
||||
const timeoutMap = new Map()
|
||||
|
||||
mainHandle(ipcMainWindowNames.wait, (event, { time, id }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const timeout = setTimeout(() => {
|
||||
if (timeoutMap.has(id)) timeoutMap.delete(id)
|
||||
resolve()
|
||||
}, time)
|
||||
timeoutMap.set(id, {
|
||||
timeout,
|
||||
resolve,
|
||||
reject,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
mainOn(ipcMainWindowNames.wait_cancel, (event, id) => {
|
||||
if (!timeoutMap.has(id)) return
|
||||
const timeout = timeoutMap.get(id)
|
||||
timeoutMap.delete(id)
|
||||
clearTimeout(timeout.timeout)
|
||||
timeout.reject('cancelled')
|
||||
})
|
||||
Reference in New Issue
Block a user