invoke commands from menu on mac

This commit is contained in:
Jan Prochazka
2022-04-14 12:33:03 +02:00
parent cc639df566
commit 374c820567
2 changed files with 8 additions and 4 deletions

View File

@@ -138,6 +138,12 @@ ipcMain.on('open-link', async (event, arg) => {
ipcMain.on('open-dev-tools', () => {
mainWindow.webContents.openDevTools();
});
ipcMain.on('app-started', async (event, arg) => {
if (runCommandOnLoad) {
mainWindow.webContents.send('run-command', runCommandOnLoad);
runCommandOnLoad = null;
}
});
ipcMain.on('window-action', async (event, arg) => {
switch (arg) {
case 'minimize':
@@ -271,10 +277,6 @@ function createWindow() {
mainWindow.setIcon(path.resolve(__dirname, '../icon.png'));
}
// mainWindow.webContents.toggleDevTools();
if (runCommandOnLoad) {
mainWindow.webContents.send('run-command', runCommandOnLoad);
runCommandOnLoad = null;
}
}
if (!apiLoaded) {