mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
fix logic (#22405)
This commit is contained in:
@@ -321,18 +321,19 @@ export class AccountManagementService implements IAccountManagementService {
|
|||||||
// Step 3) Update the account cache and fire an event
|
// Step 3) Update the account cache and fire an event
|
||||||
return this.doWithProvider(accountKey.providerId, async provider => {
|
return this.doWithProvider(accountKey.providerId, async provider => {
|
||||||
const result = await this._accountStore.remove(accountKey);
|
const result = await this._accountStore.remove(accountKey);
|
||||||
|
let indexToRemove: number = provider.accounts.findIndex(account => {
|
||||||
|
return account.key.accountId === accountKey.accountId;
|
||||||
|
});
|
||||||
await provider.provider.clear(accountKey);
|
await provider.provider.clear(accountKey);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
let indexToRemove: number = provider.accounts.findIndex(account => {
|
|
||||||
return account.key.accountId === accountKey.accountId;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (indexToRemove >= 0) {
|
if (indexToRemove >= 0) {
|
||||||
provider.accounts.splice(indexToRemove, 1);
|
provider.accounts.splice(indexToRemove, 1);
|
||||||
this.fireAccountListUpdate(provider, false);
|
this.fireAccountListUpdate(provider, false);
|
||||||
|
} else {
|
||||||
|
this._logService.error(`Error when removing an account: ${accountKey.accountId} could not find account in provider list.`);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user