Fix import of is-dev

master
Dave Conway-Jones 2024-01-23 14:12:26 +00:00
rodzic 15fbafd631
commit 5312ec9dd4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 1DDB0E91A28C2643
2 zmienionych plików z 23 dodań i 21 usunięć

42
main.js
Wyświetl plik

@ -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({

Wyświetl plik

@ -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",