Browse Source

Don't unconditionally enable/disable auto_launch.

pull/3202/head
TheGoddessInari 5 years ago
parent
commit
d78a4ea394
No known key found for this signature in database
GPG Key ID: 1209B1B7632D69A
  1. 19
      electron/main.js

19
electron/main.js

@ -74,11 +74,20 @@ const appLauncher = new AutoLaunch({
name: 'Hamsket'
,isHidden: config.get('start_minimized')
});
if (config.get('auto_launch') && !isDev) {
appLauncher.enable();
}
else {
appLauncher.disable();
if (!isDev) {
appLauncher
.isEnabled()
.then((isEnabled) => {
if (config.get('auto_launch') && !isEnabled) {
appLauncher.enable();
} else if (!config.get('auto_launch') && isEnabled) {
appLauncher.disable();
}
return;
})
.catch((err) => {
console.log(err);
});
}
// Keep a global reference of the window object, if you don't, the window will

Loading…
Cancel
Save