fix the account not found error when creating firewall rules (#2543)

This commit is contained in:
Alan Ren
2018-09-12 13:32:40 -07:00
committed by GitHub
parent 801e201cc3
commit d85bf4f6dd

View File

@@ -90,6 +90,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
} }
public $getSecurityToken(account: sqlops.Account): Thenable<{}> { public $getSecurityToken(account: sqlops.Account): Thenable<{}> {
return this.$getAllAccounts().then(() => {
for (const handle in this._accounts) { for (const handle in this._accounts) {
const providerHandle = parseInt(handle); const providerHandle = parseInt(handle);
if (this._accounts[handle].findIndex((acct) => acct.key.accountId === account.key.accountId) !== -1) { if (this._accounts[handle].findIndex((acct) => acct.key.accountId === account.key.accountId) !== -1) {
@@ -98,6 +99,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
} }
throw new Error(`Account ${account.key.accountId} not found.`); throw new Error(`Account ${account.key.accountId} not found.`);
});
} }
public get onDidChangeAccounts(): Event<sqlops.DidChangeAccountsParams> { public get onDidChangeAccounts(): Event<sqlops.DidChangeAccountsParams> {