Skip to content

Commit f6988e3

Browse files
committed
reload project node after re-auth
1 parent 6d464e0 commit f6988e3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/core/src/sagemakerunifiedstudio/explorer/activation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
113113
if (connection) {
114114
try {
115115
await smusAuthProvider.reauthenticate(connection)
116+
const projectNode = smusRootNode.getProjectSelectNode()
117+
const project = projectNode.getProject()
118+
if (!project) {
119+
await vscode.commands.executeCommand('aws.smus.switchProject')
120+
}
116121
treeDataProvider.refresh()
117122

118123
// IAM connections handle their own success messages

packages/core/src/test/sagemakerunifiedstudio/explorer/activation.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ describe('SMUS Explorer Activation', function () {
6161

6262
mockSmusRootNode = {
6363
getChildren: sinon.stub().resolves([]),
64-
getProjectSelectNode: sinon.stub().returns({ refreshNode: sinon.stub().resolves() }),
64+
getProjectSelectNode: sinon.stub().returns({
65+
getProject: sinon.stub().returns({ id: 'test-project', name: 'Test Project' }),
66+
refreshNode: sinon.stub().resolves(),
67+
}),
6568
} as any
6669

6770
// Stub vscode APIs

0 commit comments

Comments
 (0)