提交 43d89f03 编写于 作者: B Benjamin Pasero

more 💄 hot exit lifecycle

上级 b790c7a9
......@@ -130,11 +130,6 @@ export class BackupService implements IBackupService {
}
public backupBeforeShutdown(dirtyToBackup: Uri[], textFileEditorModelManager: ITextFileEditorModelManager, quitRequested: boolean, confirmCallback: () => boolean | TPromise<boolean>): boolean | TPromise<boolean> {
// If there are no dirty files, clean up and exit
if (dirtyToBackup.length === 0) {
return this.cleanupBackupsBeforeShutdown();
}
return this.backupFileService.getWorkspaceBackupPaths().then(workspaceBackupPaths => {
// When quit is requested skip the confirm callback and attempt to backup all workspaces.
// When quit is not requested the confirm callback should be shown when the window being
......
......@@ -112,13 +112,14 @@ export abstract class TextFileService implements ITextFileService {
private beforeShutdown(quitRequested: boolean): boolean | TPromise<boolean> {
// Special shutdown logic when hot exit is enabled
if (this.backupService.isHotExitEnabled) {
return this.backupService.backupBeforeShutdown(this.getDirty(), this.models, quitRequested, this.confirmBeforeShutdown.bind(this));
}
// Dirty files need treatment on shutdown
const dirty = this.getDirty();
if (dirty.length) {
// Otherwise: Dirty files need treatment on shutdown
if (this.getDirty().length) {
// Special shutdown logic when hot exit is enabled
if (this.backupService.isHotExitEnabled) {
return this.backupService.backupBeforeShutdown(dirty, this.models, quitRequested, this.confirmBeforeShutdown.bind(this));
}
// If auto save is enabled, save all files and then check again for dirty files
if (this.getAutoSaveMode() !== AutoSaveMode.OFF) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册