Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c765c202 authored by VIAUD Nathan's avatar VIAUD Nathan
Browse files

fix

parent c4d0019e
No related branches found
No related tags found
1 merge request!100Resolve "Open from file not working if editor is not running"
Pipeline #895329 passed
...@@ -14,8 +14,7 @@ const headless = process.argv.includes('--headless=true'); ...@@ -14,8 +14,7 @@ const headless = process.argv.includes('--headless=true');
let mainWindow; let mainWindow;
let splashWindow; let splashWindow;
// Open file with editor, on windows : using argv | on macOS using open-file event (see below) let filepath = process.argv[1] ? path.normalize(process.argv[1]) : null;
let filepath = process.platform === 'win32' && process.argv[1] ? path.normalize(process.argv[1]) : null;
app.on('will-finish-launching', () => { app.on('will-finish-launching', () => {
app.on('open-file', async (event, path) => { app.on('open-file', async (event, path) => {
...@@ -47,12 +46,13 @@ app.whenReady().then(() => { ...@@ -47,12 +46,13 @@ app.whenReady().then(() => {
mainWindow.show(); mainWindow.show();
} }
setupWindow(mainWindow);
if (filepath) { if (filepath) {
mainWindow.webContents.send('epocProjectPicked', JSON.stringify({name: null, modified: null, filepath: filepath, workdir: null})); mainWindow.webContents.send('epocProjectPicked', JSON.stringify({name: null, modified: null, filepath: filepath, workdir: null}));
} }
}); });
setupWindow(mainWindow);
app.on('activate', function () { app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the dock icon is clicked and there are no other windows open. // On macOS it's common to re-create a window in the app when the dock icon is clicked and there are no other windows open.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment