mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Handle no matching account scenario (#22908)
This commit is contained in:
@@ -967,15 +967,18 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
if (accountName) {
|
||||
// For backwards compatibility with ADAL, we need to check if the account ID matches with tenant Id or just the account ID
|
||||
// The OR case can be removed once we no longer support ADAL
|
||||
account = this._azureAccountList.find(account => account.key.accountId === this.getModelValue(accountName)
|
||||
account = this._azureAccountList?.find(account => account.key.accountId === this.getModelValue(accountName)
|
||||
|| account.key.accountId.split('.')[0] === this.getModelValue(accountName));
|
||||
this._azureAccountDropdown.selectWithOptionName(account.key.accountId);
|
||||
} else {
|
||||
if (account) {
|
||||
this._azureAccountDropdown.selectWithOptionName(account.key.accountId);
|
||||
}
|
||||
}
|
||||
if (!account) {
|
||||
// If account was not filled in from received configuration, select the first account.
|
||||
this._azureAccountDropdown.select(0);
|
||||
account = this._azureAccountList[0];
|
||||
if (this._azureAccountList.length > 0) {
|
||||
accountName = account.key.accountId;
|
||||
accountName = account?.key?.accountId;
|
||||
} else {
|
||||
this._logService.debug('fillInConnectionInputs: No accounts available');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user