Hide the main window on Mac auto-start

This commit is contained in:
Yuya Ochiai
2018-08-28 22:28:47 +09:00
parent c98b7c2036
commit 9f9f5de5dd
2 changed files with 19 additions and 5 deletions

17
src/main/utils.js Normal file
View File

@@ -0,0 +1,17 @@
// Copyright (c) 2015-2016 Yuya Ochiai
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {app} from 'electron';
export function shouldBeHiddenOnStartup(parsedArgv) {
if (parsedArgv.hidden) {
return true;
}
if (process.platform === 'darwin') {
if (app.getLoginItemSettings().wasOpenedAsHidden) {
return true;
}
}
return false;
}