Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit da4ab11

Browse files
Remove the remaining isDev functionality since it was never very useful
This also broke some stuff with newer versions. Should be no (actual) functional change.
1 parent ef2c06f commit da4ab11

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

electron/main.js

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ const tray = require('./tray');
77
const AutoLaunch = require('auto-launch');
88
// Configuration
99
const Config = require('electron-store');
10-
// Development
11-
const isDev = require('electron-is-dev');
1210
// Updater
1311
const updater = require('./updater');
1412
// File System
@@ -30,7 +28,7 @@ const config = new Config({
3028
,hide_menu_bar: false
3129
,tabbar_location: 'top'
3230
,window_display_behavior: 'taskbar_tray'
33-
,auto_launch: !isDev
31+
,auto_launch: false
3432
,flash_frame: true
3533
,window_close_behavior: 'keep_in_tray'
3634
,start_minimized: false
@@ -75,24 +73,22 @@ const appMenu = require('./menu')(config);
7573

7674
// Configure AutoLaunch
7775
const appLauncher = new AutoLaunch({
78-
name: 'Hamsket'
79-
,isHidden: config.get('start_minimized')
76+
name: 'Hamsket',
77+
isHidden: config.get('start_minimized')
8078
});
81-
if (!isDev) {
82-
appLauncher
83-
.isEnabled()
84-
.then((isEnabled) => {
85-
if (config.get('auto_launch') && !isEnabled) {
86-
appLauncher.enable();
87-
} else if (!config.get('auto_launch') && isEnabled) {
88-
appLauncher.disable();
89-
}
90-
return;
91-
})
92-
.catch((err) => {
93-
console.log(err);
94-
});
95-
}
79+
appLauncher
80+
.isEnabled()
81+
.then((isEnabled) => {
82+
if (config.get('auto_launch') && !isEnabled) {
83+
appLauncher.enable();
84+
} else if (!config.get('auto_launch') && isEnabled) {
85+
appLauncher.disable();
86+
}
87+
return;
88+
})
89+
.catch((err) => {
90+
console.log(err);
91+
});
9692

9793
// Keep a global reference of the window object, if you don't, the window will
9894
// be closed automatically when the JavaScript object is garbage collected.
@@ -147,9 +143,6 @@ function createWindow () {
147143

148144
process.setMaxListeners(10000);
149145

150-
// Open the DevTools.
151-
if ( isDev ) mainWindow.webContents.openDevTools();
152-
153146
// and load the index.html of the app.
154147
mainWindow.loadURL('file://' + __dirname + '/../index.html');
155148

@@ -241,8 +234,6 @@ function createMasterPasswordWindow() {
241234
}
242235

243236
});
244-
// Open the DevTools.
245-
if ( isDev ) mainMasterPasswordWindow.webContents.openDevTools();
246237

247238
mainMasterPasswordWindow.loadURL('file://' + __dirname + '/../masterpassword.html');
248239
mainMasterPasswordWindow.on('close', function() { mainMasterPasswordWindow = null; });

0 commit comments

Comments
 (0)