Merge branch 'master' into dev

This commit is contained in:
lyswhut
2020-04-03 20:13:54 +08:00
36 changed files with 220 additions and 82 deletions
+6 -1
View File
@@ -5,6 +5,9 @@ const { mainOn } = require('../../common/ipc')
autoUpdater.logger = log
// autoUpdater.autoDownload = false
autoUpdater.logger.transports.file.level = 'info'
let isFirstCheckedUpdate = true
log.info('App starting...')
@@ -67,7 +70,7 @@ const handleSendEvent = action => {
}
}
module.exports = isFirstCheckedUpdate => {
module.exports = () => {
if (!isFirstCheckedUpdate) {
if (waitEvent.length) {
waitEvent.forEach((event, index) => {
@@ -79,6 +82,8 @@ module.exports = isFirstCheckedUpdate => {
}
return
}
isFirstCheckedUpdate = false
autoUpdater.on('checking-for-update', () => {
sendStatusToWindow('Checking for update...')
})
+13 -3
View File
@@ -1,12 +1,22 @@
const Store = require('electron-store')
const { windowSizeList } = require('../../common/config')
exports.getWindowSizeInfo = () => {
let electronStore = new Store()
const { windowSizeId = 1 } = electronStore.get('setting') || {}
exports.getWindowSizeInfo = ({ windowSizeId = 1 } = {}) => {
return windowSizeList.find(i => i.id === windowSizeId) || windowSizeList[0]
}
exports.getAppSetting = () => {
let electronStore = new Store()
const defaultSetting = {
windowSizeId: 1,
tray: {
isShow: false,
isToTray: false,
},
}
return Object.assign(defaultSetting, electronStore.get('setting') || {})
}
exports.parseEnv = () => {
const params = {}
const rx = /^-\w+/