Fix default auth and 'AzureTenantId' to persist and not reset on selection event (#21289)

This commit is contained in:
Cheena Malhotra
2022-11-23 17:39:03 -08:00
committed by GitHub
parent 86c3f315f2
commit 405b3bbfdb
11 changed files with 24 additions and 20 deletions

View File

@@ -686,17 +686,15 @@ export class ConnectionWidget extends lifecycle.Disposable {
}
private onAzureTenantSelected(tenantIndex: number): void {
this._azureTenantId = undefined;
let account = this._azureAccountList.find(account => account.key.accountId === this._azureAccountDropdown.value);
if (account && account.properties.tenants) {
let tenant = account.properties.tenants[tenantIndex];
if (tenant) {
this._azureTenantId = tenant.id;
this._callbacks.onAzureTenantSelection(tenant.id);
}
else {
// This should ideally never ever happen!
this._logService.error(`onAzureTenantSelected : Could not find tenant with ID ${this._azureTenantId} for account ${account.displayInfo.displayName}`);
this._logService.error(`onAzureTenantSelected : Tenant list not found as expected, missing tenant on index ${tenantIndex}`);
}
}
}