@@ -84,7 +84,7 @@ function createMainWindow(): Electron.BrowserWindow {
8484
8585 // Keep the app running in background on close event
8686 win . on ( "close" , ( event ) => {
87- if ( ConfigUtil . getConfigItem ( "quitOnClose" ) ) {
87+ if ( ConfigUtil . getConfigItem ( "quitOnClose" , false ) ) {
8888 app . quit ( ) ;
8989 }
9090
@@ -180,7 +180,7 @@ app.commandLine.appendSwitch("force-color-profile", "srgb");
180180
181181 ipcMain . on ( "set-spellcheck-langs" , ( ) => {
182182 ses . setSpellCheckerLanguages (
183- ConfigUtil . getConfigItem ( "spellcheckerLanguages" ) ,
183+ ConfigUtil . getConfigItem ( "spellcheckerLanguages" , null ) ?? [ ] ,
184184 ) ;
185185 } ) ;
186186 AppMenu . setMenu ( {
@@ -190,18 +190,18 @@ app.commandLine.appendSwitch("force-color-profile", "srgb");
190190
191191 // Auto-hide menu bar on Windows + Linux
192192 if ( process . platform !== "darwin" ) {
193- const shouldHideMenu = ConfigUtil . getConfigItem ( "autoHideMenubar" ) || false ;
193+ const shouldHideMenu = ConfigUtil . getConfigItem ( "autoHideMenubar" , false ) ;
194194 mainWindow . autoHideMenuBar = shouldHideMenu ;
195195 mainWindow . setMenuBarVisibility ( ! shouldHideMenu ) ;
196196 }
197197
198198 // Initialize sentry for main process
199- const errorReporting = ConfigUtil . getConfigItem ( "errorReporting" ) ;
199+ const errorReporting = ConfigUtil . getConfigItem ( "errorReporting" , true ) ;
200200 if ( errorReporting ) {
201201 sentryInit ( ) ;
202202 }
203203
204- const isSystemProxy = ConfigUtil . getConfigItem ( "useSystemProxy" ) ;
204+ const isSystemProxy = ConfigUtil . getConfigItem ( "useSystemProxy" , false ) ;
205205
206206 if ( isSystemProxy ) {
207207 ( async ( ) => ProxyUtil . resolveSystemProxy ( mainWindow ) ) ( ) ;
@@ -210,7 +210,7 @@ app.commandLine.appendSwitch("force-color-profile", "srgb");
210210 const page = mainWindow . webContents ;
211211
212212 page . on ( "dom-ready" , ( ) => {
213- if ( ConfigUtil . getConfigItem ( "startMinimized" ) ) {
213+ if ( ConfigUtil . getConfigItem ( "startMinimized" , false ) ) {
214214 mainWindow . hide ( ) ;
215215 } else {
216216 mainWindow . show ( ) ;
@@ -237,7 +237,7 @@ app.commandLine.appendSwitch("force-color-profile", "srgb");
237237
238238 page . once ( "did-frame-finish-load" , async ( ) => {
239239 // Initiate auto-updates on MacOS and Windows
240- if ( ConfigUtil . getConfigItem ( "autoUpdate" ) ) {
240+ if ( ConfigUtil . getConfigItem ( "autoUpdate" , true ) ) {
241241 await appUpdater ( ) ;
242242 }
243243 } ) ;
0 commit comments