diff --git a/package.json b/package.json index fc1dc43..03d22b7 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "copy-webpack-plugin": "^5.0.4", "cross-env": "^6.0.3", "css-loader": "^3.2.0", - "electron": "^6.0.11", + "electron": "beta", "electron-builder": "^21.2.0", "electron-devtools-installer": "^2.2.4", "electron-store": "^5.0.0", diff --git a/src/main/index.js b/src/main/index.js index b5bf913..9e62dfe 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1,5 +1,11 @@ const path = require('path') -const { app, BrowserWindow, systemPreferences, ipcMain } = require('electron') +const { + app, + BrowserWindow, + systemPreferences, + nativeTheme, + ipcMain +} = require('electron') const pkg = require('../../package.json') const buildMenu = require('./menu') const { buildTouchbar, updateTouchbar } = require('./touchbar') @@ -21,7 +27,7 @@ const width = 640 const height = 450 const createWindow = async () => { - const isDarkMode = systemPreferences.isDarkMode() + const isDarkMode = nativeTheme.shouldUseDarkColors mainWindow = new BrowserWindow({ width, @@ -187,7 +193,7 @@ if (process.platform === 'windows') { // const switchTheme = () => { if (process.platform === 'darwin') { - const isDarkMode = systemPreferences.isDarkMode() + const isDarkMode = nativeTheme.shouldUseDarkColors isDarkMode ? mainWindow.webContents.executeJavaScript( diff --git a/src/main/menu.js b/src/main/menu.js index fd247ca..e82c00c 100644 --- a/src/main/menu.js +++ b/src/main/menu.js @@ -82,7 +82,7 @@ const buildMenu = mainWindow => { if (process.platform === 'darwin') { template.unshift({ - label: app.getName(), + label: app.name, submenu: [ { role: 'about'