I have a bit of a problem that I hope someone could help me with.
I have an Electron + React desktop application, and I need to handle properly its closing. When I close the aplication (click on the X on the window) the program stops, however, the terminal windows that I used to run the program doesnt stop.
I use this script to run the program:
npm run electron-dev
That does:
"scripts": {
   "start": "react-scripts start",
   "electron-dev": "concurrently \"npm run start\" \"wait-on http://localhost:3000 && electron .\""
 }
I run my app normally, when I close the window, my terminal goes:
wait-on http://localhost:3000 && electron . exited with code 0
But I cant type on my terminal unless I kill the program with a Control + C.
Here is how I'm handling the app closing:
app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
     app.quit();
   }
});
app.on('before-quit', () => {
    mainWindow.removeAllListeners('close');
    mainWindow.close();
});
Can someone help me with this?
 
     
     
    