Experimental electron support fixes

This commit is contained in:
Farkas József
2016-09-04 20:15:25 +02:00
parent e5accdc939
commit 858fa0d87c
2 changed files with 6 additions and 10 deletions

View File

@@ -17,10 +17,7 @@ function createWindow() {
const indexPath = path.resolve(__dirname, '../dist/index.html');
// and load the index.html of the app.
win.loadURL(`file://${indexPath}`)
// Open the DevTools.
win.webContents.openDevTools()
win.loadURL(`file://${indexPath}`);
// Emitted when the window is closed.
win.on('closed', () => {
@@ -28,13 +25,13 @@ function createWindow() {
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null;
})
});
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
app.on('ready', createWindow);
// Quit when all windows are closed.
app.on('window-all-closed', () => {
@@ -43,7 +40,7 @@ app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
})
});
app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
@@ -51,7 +48,7 @@ app.on('activate', () => {
if (win === null) {
createWindow()
}
})
});
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here

View File

@@ -2,7 +2,6 @@
"name": "uhk-agent",
"version": "0.0.1",
"description": "Agent is the configuration application of the Ultimate Hacking Keyboard.",
"main": "electron/main.js",
"repository": {
"type": "git",
"url": "git@github.com:UltimateHackingKeyboard/agent.git"
@@ -62,6 +61,6 @@
"build": "gulp",
"build:test": "webpack --config \"test-serializer/webpack.config.js\"",
"dev": "webpack-dev-server --config \"src/webpack.config.js\" --content-base \"./dist\"",
"electron": "electron ."
"electron": "electron electron/index.js"
}
}