mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 17:22:59 -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
|
||||
return this.doWithProvider(accountKey.providerId, async provider => {
|
||||
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);
|
||||
if (!result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
let indexToRemove: number = provider.accounts.findIndex(account => {
|
||||
return account.key.accountId === accountKey.accountId;
|
||||
});
|
||||
|
||||
if (indexToRemove >= 0) {
|
||||
provider.accounts.splice(indexToRemove, 1);
|
||||
this.fireAccountListUpdate(provider, false);
|
||||
} else {
|
||||
this._logService.error(`Error when removing an account: ${accountKey.accountId} could not find account in provider list.`);
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user