mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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) {
|
if (accountName) {
|
||||||
// For backwards compatibility with ADAL, we need to check if the account ID matches with tenant Id or just the account ID
|
// 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
|
// 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));
|
|| account.key.accountId.split('.')[0] === this.getModelValue(accountName));
|
||||||
|
if (account) {
|
||||||
this._azureAccountDropdown.selectWithOptionName(account.key.accountId);
|
this._azureAccountDropdown.selectWithOptionName(account.key.accountId);
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
if (!account) {
|
||||||
// If account was not filled in from received configuration, select the first account.
|
// If account was not filled in from received configuration, select the first account.
|
||||||
this._azureAccountDropdown.select(0);
|
this._azureAccountDropdown.select(0);
|
||||||
account = this._azureAccountList[0];
|
account = this._azureAccountList[0];
|
||||||
if (this._azureAccountList.length > 0) {
|
if (this._azureAccountList.length > 0) {
|
||||||
accountName = account.key.accountId;
|
accountName = account?.key?.accountId;
|
||||||
} else {
|
} else {
|
||||||
this._logService.debug('fillInConnectionInputs: No accounts available');
|
this._logService.debug('fillInConnectionInputs: No accounts available');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user