Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ const mainWindow = (() => {
return shell.openExternal(url);
});

// Flag to determine is user is trying to quit the whole application altogether
let quitting = false;

// Closing the chat window should just hide it (vs. fully quitting the application)
browserWindow.on('close', (evt) => {
if (!quitting) {
evt.preventDefault();
browserWindow.minimize();
}
});

app.on('before-quit', () => quitting = true);
app.on('activate', () => browserWindow.show());

ipcMain.on('request-visibility', (event) => {
// This is how synchronous messages work in Electron
// eslint-disable-next-line no-param-reassign
Expand Down