kopia lustrzana https://github.com/dceejay/electron-node-red
Fix import of is-dev
rodzic
15fbafd631
commit
5312ec9dd4
42
main.js
42
main.js
|
@ -39,9 +39,11 @@ const path = require('path');
|
|||
const http = require('http');
|
||||
const express = require("express");
|
||||
const electron = require('electron');
|
||||
// const isDev = require('electron-is-dev');
|
||||
const Store = require('electron-store');
|
||||
const store = new Store();
|
||||
const store = new Store()
|
||||
|
||||
var isDev
|
||||
(async () => { isDev = await import('electron-is-dev'); })()
|
||||
|
||||
const {app, Menu, TouchBar} = electron;
|
||||
const ipc = electron.ipcMain;
|
||||
|
@ -257,24 +259,24 @@ if (process.platform === 'darwin') {
|
|||
}
|
||||
|
||||
// Add Dev menu if in dev mode
|
||||
// if (isDev) {
|
||||
// template.push({
|
||||
// label: 'Development',
|
||||
// submenu: [
|
||||
// { label: 'Reload', accelerator: 'CmdOrCtrl+R',
|
||||
// click (item, focusedWindow) {
|
||||
// if (focusedWindow) focusedWindow.reload()
|
||||
// }
|
||||
// },
|
||||
// { label: 'Toggle Developer Tools',
|
||||
// accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
|
||||
// click (item, focusedWindow) {
|
||||
// if (focusedWindow) focusedWindow.webContents.toggleDevTools()
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// })
|
||||
// }
|
||||
if (isDev) {
|
||||
template.push({
|
||||
label: 'Development',
|
||||
submenu: [
|
||||
{ label: 'Reload', accelerator: 'CmdOrCtrl+R',
|
||||
click (item, focusedWindow) {
|
||||
if (focusedWindow) focusedWindow.reload()
|
||||
}
|
||||
},
|
||||
{ label: 'Toggle Developer Tools',
|
||||
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
|
||||
click (item, focusedWindow) {
|
||||
if (focusedWindow) focusedWindow.webContents.toggleDevTools()
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
function saveFlow() {
|
||||
const file_path = dialog.showSaveDialogSync({
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"url": "git+https://github.com/dceejay/electron-node-red.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"electron-is-dev": "^2.0.0",
|
||||
"electron-is-dev": "^3.0.1",
|
||||
"electron-store": "^8.0.1",
|
||||
"express": "^4.17.2",
|
||||
"fs-extra": "^11.2.0",
|
||||
|
|
Ładowanie…
Reference in New Issue