File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,10 @@ export class SwitchInfo {
4747 </div>
4848 ` ;
4949 this . divElement . querySelector ( '.right' ) . addEventListener ( 'click' , async ( ev : MouseEvent ) => {
50+ this . options . on = ! this . options . on
5051 const newConfig = await getCoreConfig ( )
51- newConfig [ this . options . key ] = ! this . options . on
52- setCoreConfig ( newConfig )
53- message . send ( 'refresh-config' )
54- window . dispatchEvent ( new Event ( "refresh" ) )
52+ newConfig [ this . options . key ] = this . options . on
53+ setCoreConfig ( newConfig ) . then ( ( ) => { message . send ( 'refresh-config' ) } )
5554 } )
5655 }
5756}
Original file line number Diff line number Diff line change @@ -47,8 +47,9 @@ export class SwitchInfo {
4747 </div>
4848 ` ;
4949 this . divElement . querySelector ( '.right input' ) . addEventListener ( 'click' , async ( ev : MouseEvent ) => {
50+ this . options . on = ! this . options . on
5051 const newConfig = await getCoreConfig ( )
51- newConfig [ this . options . key ] = ! this . options . on
52+ newConfig [ this . options . key ] = this . options . on
5253 setCoreConfig ( newConfig ) . then ( ( ) => message . send ( 'refresh-config' ) )
5354 } )
5455 }
You can’t perform that action at this time.
0 commit comments