We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d65f568 commit 3935152Copy full SHA for 3935152
public/electron.js
@@ -47,7 +47,16 @@ const createWindow = () => {
47
mainWindow.webContents.openDevTools();
48
}
49
50
- mainWindow.on('closed', () => (mainWindow = null));
+ mainWindow.on('closed', () => mainWindow = null);
51
+
52
+ mainWindow.on('close', (event) => {
53
+ if (app.quitting) {
54
+ mainWindow = null;
55
+ } else {
56
+ event.preventDefault();
57
+ mainWindow.hide();
58
+ }
59
+ });
60
61
destroyStream = registerEvents(mainWindow);
62
};
@@ -65,5 +74,9 @@ app.on('window-all-closed', () => {
65
74
app.on('activate', () => {
66
75
if (!mainWindow) {
67
76
createWindow();
77
78
+ mainWindow.show();
68
79
69
80
});
81
82
+app.on('before-quit', () => app.quitting = true);
0 commit comments