Attach To is set to 'Localhost' upon cancelling the connection dialog (#3941)

* #3924: Attach To sets 'Localhost' upon cancelling the connection dialog

* Indentation
This commit is contained in:
Raj
2019-02-06 16:05:42 -08:00
committed by GitHub
parent f9fe88898d
commit 5a0100757f
2 changed files with 5 additions and 6 deletions

View File

@@ -336,14 +336,14 @@ export class AttachToDropdown extends SelectBox {
await this._connectionDialogService.openDialogAndWait(this._connectionManagementService, { connectionType: 1, providers: this.model.getApplicableConnectionProviderIds(this.model.clientSession.kernel.name) }).then(connection => {
let attachToConnections = this.values;
if (!connection) {
this.loadAttachToDropdown(this.model, this.model.clientSession.kernel.name);
this.loadAttachToDropdown(this.model, this.getKernelDisplayName());
return;
}
let connectionProfile = new ConnectionProfile(this._capabilitiesService, connection);
let connectedServer = connectionProfile.serverName;
//Check to see if the same server is already there in dropdown. We only have server names in dropdown
if (attachToConnections.some(val => val === connectedServer)) {
this.loadAttachToDropdown(this.model, this.model.clientSession.kernel.name);
this.loadAttachToDropdown(this.model, this.getKernelDisplayName());
this.doChangeContext();
return;
}