File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/vs/platform/update/electron-main Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -341,12 +341,17 @@ export abstract class AbstractUpdateService implements IUpdateService {
341341 }
342342 }
343343
344+ // Remember the Ready state so we can restore it if the quit is vetoed
345+ const readyState = this . state ;
346+
344347 this . setState ( State . Restarting ( this . state . update ) ) ;
345348 this . logService . trace ( 'update#quitAndInstall(): before lifecycle quit()' ) ;
346349
347350 this . lifecycleMainService . quit ( true /* will restart */ ) . then ( vetod => {
348351 this . logService . trace ( `update#quitAndInstall(): after lifecycle quit() with veto: ${ vetod } ` ) ;
349352 if ( vetod ) {
353+ this . logService . info ( 'update#quitAndInstall(): quit was vetoed, restoring Ready state' ) ;
354+ this . setState ( readyState ) ;
350355 return ;
351356 }
352357
Original file line number Diff line number Diff line change @@ -115,11 +115,17 @@ abstract class AbstractUpdateService implements IUpdateService {
115115 return Promise . resolve ( undefined ) ;
116116 }
117117
118+ // Remember the Ready state so we can restore it if the quit is vetoed
119+ const readyState = this . state ;
120+
121+ this . setState ( State . Restarting ( this . state . update ) ) ;
118122 this . logService . trace ( 'update#quitAndInstall(): before lifecycle quit()' ) ;
119123
120124 this . lifecycleMainService . quit ( true /* will restart */ ) . then ( vetod => {
121125 this . logService . trace ( `update#quitAndInstall(): after lifecycle quit() with veto: ${ vetod } ` ) ;
122126 if ( vetod ) {
127+ this . logService . info ( 'update#quitAndInstall(): quit was vetoed, restoring Ready state' ) ;
128+ this . setState ( readyState ) ;
123129 return ;
124130 }
125131
You can’t perform that action at this time.
0 commit comments