File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -24,22 +24,21 @@ autoUpdater.on('error', error => {
2424} )
2525
2626autoUpdater . on ( 'update-available' , ( ) => {
27- dialog . showMessageBox (
28- {
27+ dialog
28+ . showMessageBox ( {
2929 type : 'info' ,
3030 title : 'Found Updates' ,
3131 message : 'Found updates, do you want update now?' ,
3232 buttons : [ 'Sure' , 'No' ]
33- } ,
34- buttonIndex => {
35- if ( buttonIndex === 0 ) {
33+ } )
34+ . then ( ( { response } ) => {
35+ if ( response === 0 ) {
3636 autoUpdater . downloadUpdate ( )
3737 } else {
3838 updater . enabled = true
3939 updater = null
4040 }
41- }
42- )
41+ } )
4342} )
4443
4544autoUpdater . on ( 'update-not-available' , ( ) => {
@@ -52,15 +51,14 @@ autoUpdater.on('update-not-available', () => {
5251} )
5352
5453autoUpdater . on ( 'update-downloaded' , ( ) => {
55- dialog . showMessageBox (
56- {
54+ dialog
55+ . showMessageBox ( {
5756 title : 'Install Updates' ,
5857 message : 'Updates downloaded, application will be quit for update...'
59- } ,
60- ( ) => {
58+ } )
59+ . then ( ( ) => {
6160 setImmediate ( ( ) => autoUpdater . quitAndInstall ( ) )
62- }
63- )
61+ } )
6462} )
6563
6664// export this to MenuItem click callback
You can’t perform that action at this time.
0 commit comments