diff options
-rw-r--r-- | src/stores/AppStore.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 42ec25204..28fe14049 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -173,24 +173,27 @@ export default class AppStore extends Store { | |||
173 | @action _launchOnStartup({ enable, openInBackground }) { | 173 | @action _launchOnStartup({ enable, openInBackground }) { |
174 | this.autoLaunchOnStart = enable; | 174 | this.autoLaunchOnStart = enable; |
175 | 175 | ||
176 | const settings = { | 176 | let settings = { |
177 | openAtLogin: enable, | 177 | openAtLogin: enable, |
178 | openAsHidden: openInBackground, | ||
179 | path: updateExe, | ||
180 | args: [ | ||
181 | '--processStart', `"${exeName}"`, | ||
182 | ], | ||
183 | }; | 178 | }; |
184 | 179 | ||
185 | // For Windows | 180 | // For Windows |
186 | if (openInBackground) { | 181 | if (process.platform === 'win32') { |
187 | settings.args.push( | 182 | settings = Object.assign({ |
188 | '--process-start-args', '"--hidden"', | 183 | openAsHidden: openInBackground, |
189 | ); | 184 | path: updateExe, |
185 | args: [ | ||
186 | '--processStart', `"${exeName}"`, | ||
187 | ], | ||
188 | }, settings); | ||
189 | |||
190 | if (openInBackground) { | ||
191 | settings.args.push( | ||
192 | '--process-start-args', '"--hidden"', | ||
193 | ); | ||
194 | } | ||
190 | } | 195 | } |
191 | 196 | ||
192 | app.setLoginItemSettings(settings); | ||
193 | |||
194 | gaEvent('App', enable ? 'enable autostart' : 'disable autostart'); | 197 | gaEvent('App', enable ? 'enable autostart' : 'disable autostart'); |
195 | } | 198 | } |
196 | 199 | ||