[MM-27332] show window at autolaunch (#1379)

This commit is contained in:
Guillermo Vayá
2020-10-05 09:10:34 +02:00
committed by GitHub
parent 1979721ac9
commit 3182a9d0b1
5 changed files with 5 additions and 17 deletions

View File

@@ -25,7 +25,6 @@ function triageArgs(args) {
function parseArgs(args) {
return yargs.
alias('hidden', 'h').boolean('hidden').describe('hidden', 'Launch the app in hidden mode.').
alias('dataDir', 'd').string('dataDir').describe('dataDir', 'Set the path to where user data is stored.').
alias('disableDevMode', 'p').boolean('disableDevMode').describe('disableDevMode', 'Disable development mode. Allows for testing as if it was Production.').
alias('version', 'v').boolean('version').describe('version', 'Prints the application version.').

View File

@@ -9,7 +9,6 @@ async function upgradeAutoLaunch() {
}
const appLauncher = new AutoLaunch({
name: 'Mattermost',
isHidden: true,
});
const enabled = await appLauncher.isEnabled();
if (enabled) {

View File

@@ -44,7 +44,6 @@ function createMainWindow(config, options) {
windowOptions = {width: defaultWindowWidth, height: defaultWindowHeight};
}
const {hideOnStartup} = options;
const {maximized: windowIsMaximized} = windowOptions;
if (process.platform === 'linux') {
@@ -81,18 +80,16 @@ function createMainWindow(config, options) {
// handle showing the window when not launched by auto-start
// - when not configured to auto-start, immediately show contents and optionally maximize as needed
if (!hideOnStartup) {
mainWindow.show();
if (windowIsMaximized) {
mainWindow.maximize();
}
mainWindow.show();
if (windowIsMaximized) {
mainWindow.maximize();
}
});
mainWindow.once('show', () => {
// handle showing the app when hidden to the tray icon by auto-start
// - optionally maximize the window as needed
if (hideOnStartup && windowIsMaximized) {
if (windowIsMaximized) {
mainWindow.maximize();
}
});
@@ -100,7 +97,7 @@ function createMainWindow(config, options) {
mainWindow.once('restore', () => {
// handle restoring the window when minimized to the app icon by auto-start
// - optionally maximize the window as needed
if (hideOnStartup && windowIsMaximized) {
if (windowIsMaximized) {
mainWindow.maximize();
}
});