Suppress unnecessary window while install/uninstalling
This commit is contained in:
@@ -14,6 +14,8 @@ Release date: TBD
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
#### Windows
|
||||||
|
- Fixed an issue where an unexpected window appears while install/uninstalling
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
10
src/main.js
10
src/main.js
@@ -18,6 +18,8 @@ process.on('uncaughtException', (error) => {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var willAppQuit = false;
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
var cmd = process.argv[1];
|
var cmd = process.argv[1];
|
||||||
var appLauncher = new AutoLaunch({
|
var appLauncher = new AutoLaunch({
|
||||||
@@ -45,7 +47,9 @@ if (process.platform === 'win32') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.setAppUserModelId('com.squirrel.mattermost.Mattermost'); // Use explicit AppUserModelID
|
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 fs = require('fs');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
@@ -173,7 +177,6 @@ const trayImages = (() => {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
var willAppQuit = false;
|
|
||||||
|
|
||||||
// If there is already an instance, activate the window in the existing instace and quit this one
|
// If there is already an instance, activate the window in the existing instace and quit this one
|
||||||
if (app.makeSingleInstance((/*commandLine, workingDirectory*/) => {
|
if (app.makeSingleInstance((/*commandLine, workingDirectory*/) => {
|
||||||
@@ -299,6 +302,9 @@ allowProtocolDialog.init(mainWindow);
|
|||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
app.on('ready', () => {
|
app.on('ready', () => {
|
||||||
|
if (willAppQuit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ipcMain.on('notified', () => {
|
ipcMain.on('notified', () => {
|
||||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||||
if (config.notifications.flashWindow === 2) {
|
if (config.notifications.flashWindow === 2) {
|
||||||
|
Reference in New Issue
Block a user