ensure start order ok

pull/8/head
Dave Conway-Jones 2016-06-19 23:57:24 +01:00
rodzic 3513b156a1
commit 951ae3bc30
2 zmienionych plików z 8 dodań i 4 usunięć

10
main.js
Wyświetl plik

@ -6,6 +6,8 @@ const electron = require('electron');
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;
// Start directly on the ui page
const url = "http://localhost:8000/ui";
const {Menu, MenuItem} = electron;
@ -84,16 +86,18 @@ function createWindow () {
height: 768,
icon: __dirname + "/nodered.png"
});
mainWindow.loadURL("http://localhost:8000/ui");
var webContents = mainWindow.webContents;
webContents.on('did-get-response-details', function(event, status, newURL, originalURL, httpResponseCode) {
if ((httpResponseCode == 404) && (newURL == "http://localhost:8000/ui")) {
setTimeout(webContents.reload, 200);
if ((httpResponseCode == 404) && (newURL == url)) {
setTimeout(webContents.reload, 250);
}
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
});
// load the initial page
setTimeout(function() {mainWindow.loadURL(url)}, 250);
// Open the DevTools.
//mainWindow.webContents.openDevTools();

Wyświetl plik

@ -27,7 +27,7 @@
},
"dependencies": {
"node-red": "^0.14.0",
"node-red-dashboard": "node-red/node-red-dashboard",
"node-red-dashboard": "node-red/node-red-dashboard#0.14.0",
"node-red-contrib-web-worldmap": "^1.0.13",
"node-red-node-geofence": "*",
"node-red-node-disco": "./node-red-node-disco-0.0.1.tgz",