diff --git a/src/sql/workbench/services/connection/browser/connectionDialogService.ts b/src/sql/workbench/services/connection/browser/connectionDialogService.ts index c2712a08de..475d734b71 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogService.ts @@ -143,9 +143,6 @@ export class ConnectionDialogService implements IConnectionDialogService { if (filteredKeys && filteredKeys.length > 0) { defaultProvider = filteredKeys[0]; } - else { - defaultProvider = keys[0]; - } } } if (!defaultProvider && this._configurationService) { @@ -304,18 +301,19 @@ export class ConnectionDialogService implements IConnectionDialogService { private handleShowUiComponent(input: OnShowUIResponse) { if (input.selectedProviderType) { // If the call is for specific providers - let isParamProvider: boolean = false; + let isProviderInParams: boolean = false; if (this._params && this._params.providers) { this._params.providers.forEach((provider) => { if (input.selectedProviderType === this._providerNameToDisplayNameMap[provider]) { - isParamProvider = true; + isProviderInParams = true; this._currentProviderType = provider; } }); } - if (!isParamProvider) { + if (!isProviderInParams) { this._currentProviderType = Object.keys(this._providerNameToDisplayNameMap).find((key) => - this._providerNameToDisplayNameMap[key] === input.selectedProviderType + this._providerNameToDisplayNameMap[key] === input.selectedProviderType && + key !== Constants.cmsProviderName ); } }