Fix restore from tray on second instance RPS-69

This commit is contained in:
Patrick Fic
2020-12-18 10:59:48 -08:00
parent 54e40e24e9
commit 18061094ac

View File

@@ -119,8 +119,8 @@ function createWindow() {
// Create the browser window.
Menu.setApplicationMenu(menu);
mainWindow = new BrowserWindow({
width: 800,
height: 600,
// width: 800,
// height: 600,
title: `ImEX RPS ${app.getVersion()}`,
icon: path.join(__dirname, "../src/assets/logo192.png"),
webPreferences: {
@@ -141,6 +141,7 @@ function createWindow() {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.show();
mainWindow.focus();
}
});
@@ -228,6 +229,7 @@ app.on("window-all-closed", () => {
app.on("activate", () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
console.log("Activate");
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}