diff --git a/src/index.js b/src/index.js index e6dfe75f..c243ce82 100644 --- a/src/index.js +++ b/src/index.js @@ -48,3 +48,10 @@ app.on('activate', () => { createWindow(); } }); + +electron.ipcMain.on('renderer-ready', () => { + if (!isDev) { + const fileToOpen = process.argv[1]; + if (fileToOpen) mainWindow.webContents.send('file-opened', [fileToOpen]); + } +}); diff --git a/src/renderer.jsx b/src/renderer.jsx index e2948440..2f4f9646 100644 --- a/src/renderer.jsx +++ b/src/renderer.jsx @@ -111,6 +111,8 @@ class App extends React.Component { keyboardJs.bind('e', () => this.cutClick()); keyboardJs.bind('i', () => this.setCutStart()); keyboardJs.bind('o', () => this.setCutEnd()); + + electron.ipcRenderer.send('renderer-ready'); } onPlay(playing) {