Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/vs/platform/update/electron-main/abstractUpdateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,17 @@ export abstract class AbstractUpdateService implements IUpdateService {
}
}

// Remember the Ready state so we can restore it if the quit is vetoed
const readyState = this.state;

this.setState(State.Restarting(this.state.update));
this.logService.trace('update#quitAndInstall(): before lifecycle quit()');

this.lifecycleMainService.quit(true /* will restart */).then(vetod => {
this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${vetod}`);
if (vetod) {
this.logService.info('update#quitAndInstall(): quit was vetoed, restoring Ready state');
this.setState(readyState);
return;
}

Expand Down
6 changes: 6 additions & 0 deletions src/vs/platform/update/electron-main/updateService.snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,17 @@ abstract class AbstractUpdateService implements IUpdateService {
return Promise.resolve(undefined);
}

// Remember the Ready state so we can restore it if the quit is vetoed
const readyState = this.state;

this.setState(State.Restarting(this.state.update));
this.logService.trace('update#quitAndInstall(): before lifecycle quit()');

this.lifecycleMainService.quit(true /* will restart */).then(vetod => {
this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${vetod}`);
if (vetod) {
this.logService.info('update#quitAndInstall(): quit was vetoed, restoring Ready state');
this.setState(readyState);
return;
}

Expand Down
Loading