Skip to content

Commit

Permalink
Linux fixes
Browse files Browse the repository at this point in the history
Resolves #61
  • Loading branch information
aaroncox committed Dec 14, 2017
1 parent d1f3b4f commit aa93d30
Show file tree
Hide file tree
Showing 3 changed files with 761 additions and 348 deletions.
17 changes: 10 additions & 7 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @flow
*/
import { app, BrowserWindow } from 'electron';
import { app, dialog, BrowserWindow } from 'electron';
import MenuBuilder from './menu';

let mainWindow = null;
Expand Down Expand Up @@ -42,7 +42,7 @@ const installExtensions = async () => {
};

const singleInstance = app.makeSingleInstance((argv, workingDirectory) => {
if (process.platform == 'win32') {
if (process.platform == 'win32' || process.platform === 'linux') {
customURI = argv.slice(1)
}
if (mainWindow) {
Expand All @@ -62,10 +62,12 @@ function devToolsLog(s) {
}

async function createWindow() {

if (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true') {
await installExtensions();
}
if (process.platform == 'win32') {

if (process.platform === 'win32' || process.platform === 'linux') {
customURI = process.argv.slice(1)
}

Expand All @@ -75,8 +77,11 @@ async function createWindow() {
height: 750
});

// mainWindow.webContents.openDevTools()

mainWindow.loadURL(`file://${__dirname}/app.html`);


// @TODO: Use 'ready-to-show' event
// https://github.com/electron/electron/blob/master/docs/api/browser-window.md#using-ready-to-show-event
mainWindow.webContents.on('did-finish-load', () => {
Expand Down Expand Up @@ -138,7 +143,5 @@ app.on('activate', function () {
}
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.quit();
});
Loading

0 comments on commit aa93d30

Please sign in to comment.