Skip to content

Commit faffcd0

Browse files
authored
fix(amazonq): sign-in notification displaying if user is signed in (#5544)
Problem: `Start using Amazon Q` can display if there is some error restoring the connection object in the main Auth class. May be a network error or some other error. This is fine because Q uses secondary auth, so it only needs to be restored in that class. However, the notification logic access is in the Auth class which may not be restored. Solution: Use AuthUtil to check if there is a connection instead of Auth. --- <!--- REMINDER: Ensure that your PR meets the guidelines in CONTRIBUTING.md --> License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 57382ad commit faffcd0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "UI: 'Start using Amazon Q' may display even if the user is signed in."
4+
}

packages/amazonq/src/app/chat/activation.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
import * as vscode from 'vscode'
77
import { ExtensionContext, window } from 'vscode'
8-
import { Auth } from 'aws-core-vscode/auth'
98
import { telemetry } from 'aws-core-vscode/telemetry'
10-
import { CodeWhispererSettings } from 'aws-core-vscode/codewhisperer'
9+
import { AuthUtil, CodeWhispererSettings } from 'aws-core-vscode/codewhisperer'
1110
import { Commands, placeholder, funcUtil } from 'aws-core-vscode/shared'
1211
import * as amazonq from 'aws-core-vscode/amazonq'
1312

@@ -81,7 +80,7 @@ async function setupAuthNotification() {
8180

8281
async function tryShowNotification() {
8382
// Do not show the notification if the IDE starts and user is already authenticated.
84-
if (Auth.instance.activeConnection) {
83+
if (AuthUtil.instance.isConnected()) {
8584
notificationDisplayed = true
8685
}
8786

0 commit comments

Comments
 (0)