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. 15
      electron/main.js

15
electron/main.js

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

Loading…
Cancel
Save