Skip to content

Commit

Permalink
#183 fix double click on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebouget committed Jul 2, 2024
1 parent 40920d4 commit 6d97ebb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ app.on('will-finish-launching', function () {
if (win) {
setTimeout(() => {
win.webContents.send('file-open-system', fileToLoad);
}, 500);
}, 2500);
} else {
// if win is not ready, wait for it
app.once('browser-window-created', () => {
setTimeout(() => {
win.webContents.send('file-open-system', fileToLoad);
}, 2500);
});
}
}
});
Expand Down Expand Up @@ -100,13 +107,6 @@ function createWindow(): BrowserWindow {
win.loadURL(url.href);
}

// Traiter le fichier ouvert après que la fenêtre soit prête
if (fileToLoad) {
win.webContents.on('did-finish-load', () => {
win.webContents.send('open-file', fileToLoad);
});
}

// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store window
Expand Down

0 comments on commit 6d97ebb

Please sign in to comment.