Skip to content

Commit

Permalink
Fix account selection prompt showing when it shouldn't when signing i…
Browse files Browse the repository at this point in the history
…nto tenant (#973)
  • Loading branch information
alexweininger authored Dec 6, 2024
1 parent af06963 commit c0fff05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/commands/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { signInToTenant } from '@microsoft/vscode-azext-azureauth';
import { AzExtTreeItem, IActionContext, isAzExtTreeItem, openUrl, registerCommand, registerErrorHandler, registerReportIssueCommand } from '@microsoft/vscode-azext-utils';
import { AuthenticationSessionAccountInformation, commands } from 'vscode';
import { commands } from 'vscode';
import { uploadFileToCloudShell } from '../cloudConsole/uploadFileToCloudShell';
import { ext } from '../extensionVariables';
import { BranchDataItemWrapper } from '../tree/BranchDataItemWrapper';
Expand Down Expand Up @@ -70,8 +70,8 @@ export function registerCommands(): void {
ext.actions.refreshTenantTree(node);
});

registerCommand('azureTenantsView.signInToTenant', async (_context, node: TenantTreeItem, account?: AuthenticationSessionAccountInformation) => {
await (await ext.subscriptionProviderFactory()).signIn(node.tenantId, account);
registerCommand('azureTenantsView.signInToTenant', async (_context, node: TenantTreeItem) => {
await (await ext.subscriptionProviderFactory()).signIn(node.tenantId, node.account);
ext.actions.refreshTenantTree(node);
});

Expand Down
2 changes: 1 addition & 1 deletion src/tree/tenants/registerTenantTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function updateTenantsSetting(_context: IActionContext, tenants: vscode.Tr
} else if (state === vscode.TreeItemCheckboxState.Checked) {
const treeItem = await tenantTreeItem.getTreeItem();
if (treeItem?.contextValue === 'tenantNameNotSignedIn') {
await vscode.commands.executeCommand('azureTenantsView.signInToTenant', tenantTreeItem, tenantTreeItem.account);
await vscode.commands.executeCommand('azureTenantsView.signInToTenant', tenantTreeItem);
ext.actions.refreshTenantTree();
}
unselectedTenantsSet.delete(getKeyForTenant(tenantTreeItem.tenantId, tenantTreeItem.account.id));
Expand Down

0 comments on commit c0fff05

Please sign in to comment.