From 3f876202c137b2af5e8396003a0dfc8a3f199b53 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 6 Sep 2019 11:47:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8DMac?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 9 --------- src/common/utils.js | 10 +++++++--- src/main/events/trafficLight.js | 3 +++ src/main/index.js | 6 ++---- src/main/utils/autoUpdate.js | 2 +- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index c22d7581..e69de29b 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,9 +0,0 @@ -### 新增 - -- 新增右上角最小化/关闭按钮鼠标滑过符号 -- 新增下载列表定位文件按钮 - -### 修复 - -- 修复百度源歌单全部分类无法加载的问题 -- 修复更新弹窗无法弹出的问题 diff --git a/src/common/utils.js b/src/common/utils.js index 831925c7..12780923 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -1,4 +1,8 @@ -export const isLinux = process.platform == 'linux' -export const isWin = process.platform == 'win32' -export const isMac = process.platform == 'darwin' +const log = require('electron-log') +exports.isLinux = process.platform == 'linux' +exports.isWin = process.platform == 'win32' +exports.isMac = process.platform == 'darwin' + + +exports.log = log diff --git a/src/main/events/trafficLight.js b/src/main/events/trafficLight.js index 58f3cca5..e2ba49f9 100644 --- a/src/main/events/trafficLight.js +++ b/src/main/events/trafficLight.js @@ -1,3 +1,4 @@ +// const { app } = require('electron') const { mainOn } = require('../../common/icp') module.exports = win => { @@ -14,6 +15,8 @@ module.exports = win => { mainOn('close', event => { if (win) { // window.destroy() + // console.log('close') + // app.quit() win.close() } }) diff --git a/src/main/index.js b/src/main/index.js index ad0ee77d..6ce9e16e 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -63,7 +63,7 @@ function createWindow() { mainWindow.loadURL(winURL) mainWindow.on('closed', () => { - mainWindow = null + if (!isMac) mainWindow = null }) // mainWindow.webContents.openDevTools() @@ -94,9 +94,7 @@ if (isMac) { app.on('ready', createWindow) app.on('window-all-closed', () => { - if (process.platform !== 'darwin') { - app.quit() - } + if (!isMac) app.quit() }) app.on('activate', () => { diff --git a/src/main/utils/autoUpdate.js b/src/main/utils/autoUpdate.js index 7514abc9..0a9e64bf 100644 --- a/src/main/utils/autoUpdate.js +++ b/src/main/utils/autoUpdate.js @@ -1,4 +1,4 @@ -const log = require('electron-log') +const { log } = require('../../common/utils') const { autoUpdater } = require('electron-updater') const { mainOn } = require('../../common/icp')