mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
Merge from master
This commit is contained in:
@@ -62,7 +62,7 @@ export class TaskService implements ITaskService {
|
||||
this._onTaskComplete = new Emitter<TaskNode>();
|
||||
this._onAddNewTask = new Emitter<TaskNode>();
|
||||
|
||||
lifecycleService.onWillShutdown(event => event.veto(this.beforeShutdown()));
|
||||
lifecycleService.onBeforeShutdown(event => event.veto(this.beforeShutdown()));
|
||||
|
||||
}
|
||||
|
||||
@@ -161,23 +161,23 @@ export class TaskService implements ITaskService {
|
||||
return new TPromise<boolean>((resolve, reject) => {
|
||||
let numOfInprogressTasks = this.getNumberOfInProgressTasks();
|
||||
if (numOfInprogressTasks > 0) {
|
||||
this.dialogService.show(Severity.Warning, message, options).done(choice => {
|
||||
this.dialogService.show(Severity.Warning, message, options).then(choice => {
|
||||
switch (choice) {
|
||||
case 0:
|
||||
let timeoutId: number;
|
||||
let timeout: NodeJS.Timer;
|
||||
let isTimeout = false;
|
||||
this.cancelAllTasks().then(() => {
|
||||
clearTimeout(timeoutId);
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}
|
||||
}, error => {
|
||||
clearTimeout(timeoutId);
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
timeoutId = setTimeout(function () {
|
||||
timeout = setTimeout(function () {
|
||||
isTimeout = true;
|
||||
resolve(false);
|
||||
}, 2000);
|
||||
|
||||
Reference in New Issue
Block a user