Suppress unnecessary window while install/uninstalling

This commit is contained in:
Yuya Ochiai
2016-12-22 23:26:18 +09:00
parent 77e9ba0a32
commit 48cb8a2bbf
2 changed files with 10 additions and 2 deletions

View File

@@ -14,6 +14,8 @@ Release date: TBD
### Bug Fixes
#### Windows
- Fixed an issue where an unexpected window appears while install/uninstalling
----

View File

@@ -18,6 +18,8 @@ process.on('uncaughtException', (error) => {
console.error(error);
});
var willAppQuit = false;
if (process.platform === 'win32') {
var cmd = process.argv[1];
var appLauncher = new AutoLaunch({
@@ -45,7 +47,9 @@ if (process.platform === 'win32') {
}
app.setAppUserModelId('com.squirrel.mattermost.Mattermost'); // Use explicit AppUserModelID
require('electron-squirrel-startup');
if (require('electron-squirrel-startup')) {
willAppQuit = true;
}
const fs = require('fs');
const os = require('os');
@@ -173,7 +177,6 @@ const trayImages = (() => {
return {};
}
})();
var willAppQuit = false;
// If there is already an instance, activate the window in the existing instace and quit this one
if (app.makeSingleInstance((/*commandLine, workingDirectory*/) => {
@@ -299,6 +302,9 @@ allowProtocolDialog.init(mainWindow);
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', () => {
if (willAppQuit) {
return;
}
ipcMain.on('notified', () => {
if (process.platform === 'win32' || process.platform === 'linux') {
if (config.notifications.flashWindow === 2) {