This repository was archived by the owner on Jun 4, 2023. It is now read-only.
File tree 3 files changed +11
-6
lines changed
3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,18 @@ export class Settings extends EventEmitter {
73
73
} ;
74
74
75
75
public update = ( ) => {
76
+ let themeSource = 'system' ;
77
+
76
78
if ( this . object . themeAuto ) {
77
79
this . object . theme = nativeTheme . shouldUseDarkColors
78
80
? 'wexond-dark'
79
81
: 'wexond-light' ;
80
-
81
- nativeTheme . themeSource = 'system' ;
82
82
} else {
83
- nativeTheme . themeSource =
84
- this . object . theme === 'wexond-dark' ? 'dark' : 'light' ;
83
+ themeSource = this . object . theme === 'wexond-dark' ? 'dark' : 'light' ;
84
+ }
85
+
86
+ if ( themeSource !== nativeTheme . themeSource ) {
87
+ nativeTheme . themeSource = themeSource as any ;
85
88
}
86
89
87
90
Application . instance . dialogs . sendToAll ( 'update-settings' , this . object ) ;
Original file line number Diff line number Diff line change @@ -305,7 +305,9 @@ export class DialogsService {
305
305
} ;
306
306
307
307
public sendToAll = ( channel : string , ...args : any [ ] ) => {
308
- this . getBrowserViews ( ) . forEach ( ( x ) => x . webContents . send ( channel , ...args ) ) ;
308
+ this . getBrowserViews ( ) . forEach (
309
+ ( x ) => ! x . isDestroyed ( ) && x . webContents . send ( channel , ...args ) ,
310
+ ) ;
309
311
} ;
310
312
311
313
public get ( name : string ) {
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ export class View {
200
200
this . emitEvent ( 'favicon-updated' , fav ) ;
201
201
} catch ( e ) {
202
202
this . favicon = '' ;
203
- console . error ( e ) ;
203
+ // console.error(e);
204
204
}
205
205
} ,
206
206
) ;
You can’t perform that action at this time.
0 commit comments