Reputation: 65
my computer is mac, Cmd+Q
can not quit the electron app! why? What should I do?
Upvotes: 3
Views: 4511
Reputation: 1135
According to the documentation of the method app.exit(exitCode):
All windows will be closed immediately without asking user and the before-quit and will-quit events will not be emitted.
So on On OS X it is common for applications and their menu bar to stay active. Try the following or change the method app.exit()
by app.quit()
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit();
}
});
Upvotes: 5