mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix console error for new connection dialog (#23612)
This commit is contained in:
@@ -991,7 +991,9 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
await this.onAzureAccountSelected();
|
||||
|
||||
let tenantId = connectionInfo.azureTenantId;
|
||||
if (account && tenantId && account.properties.tenants && account.properties.tenants.length > 1) {
|
||||
if (account && account.properties.tenants) {
|
||||
if (account.properties.tenants.length > 1) {
|
||||
if (tenantId) {
|
||||
let tenant = account.properties.tenants.find(tenant => tenant.id === tenantId);
|
||||
if (tenant) {
|
||||
this._azureTenantDropdown.selectWithOptionName(tenant.displayName);
|
||||
@@ -1004,10 +1006,13 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
this.onAzureTenantSelected(this._azureTenantDropdown.values.indexOf(this._azureTenantDropdown.value));
|
||||
}
|
||||
}
|
||||
else if (account && account.properties.tenants && account.properties.tenants.length === 1) {
|
||||
// else don't do anything if tenant Id is not set.
|
||||
}
|
||||
else if (account.properties.tenants.length === 1) {
|
||||
this._azureTenantId = account.properties.tenants[0].id;
|
||||
this.onAzureTenantSelected(0);
|
||||
}
|
||||
}
|
||||
else if (accountName) {
|
||||
this._logService.error(`fillInConnectionInputs : Could not find any tenants for account ${accountName}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user