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 http = require('http');
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const electron = require('electron');
|
const electron = require('electron');
|
||||||
// const isDev = require('electron-is-dev');
|
|
||||||
const Store = require('electron-store');
|
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 {app, Menu, TouchBar} = electron;
|
||||||
const ipc = electron.ipcMain;
|
const ipc = electron.ipcMain;
|
||||||
|
@ -257,24 +259,24 @@ if (process.platform === 'darwin') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Dev menu if in dev mode
|
// Add Dev menu if in dev mode
|
||||||
// if (isDev) {
|
if (isDev) {
|
||||||
// template.push({
|
template.push({
|
||||||
// label: 'Development',
|
label: 'Development',
|
||||||
// submenu: [
|
submenu: [
|
||||||
// { label: 'Reload', accelerator: 'CmdOrCtrl+R',
|
{ label: 'Reload', accelerator: 'CmdOrCtrl+R',
|
||||||
// click (item, focusedWindow) {
|
click (item, focusedWindow) {
|
||||||
// if (focusedWindow) focusedWindow.reload()
|
if (focusedWindow) focusedWindow.reload()
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
// { label: 'Toggle Developer Tools',
|
{ label: 'Toggle Developer Tools',
|
||||||
// accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
|
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
|
||||||
// click (item, focusedWindow) {
|
click (item, focusedWindow) {
|
||||||
// if (focusedWindow) focusedWindow.webContents.toggleDevTools()
|
if (focusedWindow) focusedWindow.webContents.toggleDevTools()
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// ]
|
]
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
|
|
||||||
function saveFlow() {
|
function saveFlow() {
|
||||||
const file_path = dialog.showSaveDialogSync({
|
const file_path = dialog.showSaveDialogSync({
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"url": "git+https://github.com/dceejay/electron-node-red.git"
|
"url": "git+https://github.com/dceejay/electron-node-red.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-is-dev": "^2.0.0",
|
"electron-is-dev": "^3.0.1",
|
||||||
"electron-store": "^8.0.1",
|
"electron-store": "^8.0.1",
|
||||||
"express": "^4.17.2",
|
"express": "^4.17.2",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
|
|
Ładowanie…
Reference in New Issue