From 85a2d994f3996233a81280c637acd85ad6bd0409 Mon Sep 17 00:00:00 2001 From: Matt Irvine Date: Tue, 13 Nov 2018 16:44:26 -0800 Subject: [PATCH] Don't close connection dialog when cancelling a connection (#3207) --- .../connection/connectionDialog/connectionDialogWidget.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sql/parts/connection/connectionDialog/connectionDialogWidget.ts b/src/sql/parts/connection/connectionDialog/connectionDialogWidget.ts index f52c8ca294..4ff2bfe1b4 100644 --- a/src/sql/parts/connection/connectionDialog/connectionDialogWidget.ts +++ b/src/sql/parts/connection/connectionDialog/connectionDialogWidget.ts @@ -83,6 +83,8 @@ export class ConnectionDialogWidget extends Modal { private _onResetConnection = new Emitter(); public onResetConnection: Event = this._onResetConnection.event; + private _connecting = false; + constructor( private providerTypeOptions: string[], private selectedProviderType: string, @@ -248,6 +250,7 @@ export class ConnectionDialogWidget extends Modal { private connect(element?: IConnectionProfile): void { if (this._connectButton.enabled) { + this._connecting = true; this._connectButton.enabled = false; this._providerTypeSelectBox.disable(); this.showSpinner(); @@ -268,8 +271,9 @@ export class ConnectionDialogWidget extends Modal { } private cancel() { + let wasConnecting = this._connecting; this._onCancel.fire(); - if (!this._databaseDropdownExpanded) { + if (!this._databaseDropdownExpanded && !wasConnecting) { this.close(); } } @@ -426,6 +430,7 @@ export class ConnectionDialogWidget extends Modal { this._connectButton.enabled = true; this._providerTypeSelectBox.enable(); this._onResetConnection.fire(); + this._connecting = false; } public get newConnectionParams(): INewConnectionParams {