Skip to content

Commit 6947870

Browse files
authored
fix(amazonq): fix Q panel will get stuck while signin if users have multiple window (#5564)
<!--- If you are a new contributor, please take a look at the README and CONTRIBUTING documents ---> <!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> <!--- If appropriate, providing screenshots will help us review your contribution --> <!--- If there is a related issue, please provide a link here --> the `project: Project` provided by AmazonQToolWindowFactory is shadowed by `project: Project` in RegionProfileListener.onProfileChanged(project: Project, profile: Profile), the consequence is only the project where profile change happens will get updated with the Chat UI (mynah-ui) ## License I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 3357e88 commit 6947870

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Q panel will get stuck while signin if users have multiple windows"
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQToolWindowFactory.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ class AmazonQToolWindowFactory : ToolWindowFactory, DumbAware {
9595
project.messageBus.connect(toolWindow.disposable).subscribe(
9696
QRegionProfileSelectedListener.TOPIC,
9797
object : QRegionProfileSelectedListener {
98-
override fun onProfileSelected(project: Project, profile: QRegionProfile?) {
98+
// note we name myProject intentionally ow it will shadow the "project" provided by the IDE
99+
override fun onProfileSelected(myProject: Project, profile: QRegionProfile?) {
99100
if (project.isDisposed) return
100101
AmazonQToolWindow.getInstance(project).disposeAndRecreate()
101102
qPanel.setContent(AmazonQToolWindow.getInstance(project).component)

0 commit comments

Comments
 (0)