Skip to content

Commit 3059127

Browse files
committed
fix: Remove redundant code and optimize tool window content creation
1 parent c110e0c commit 3059127

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/SendToWindow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fun sendToChatWindow(
2525
val content = contentManager.factory.createContent(contentPanel, chatCodingService.getLabel(), false)
2626

2727
ApplicationManager.getApplication().invokeLater {
28-
contentManager.removeAllContents(false)
2928
contentManager.addContent(content)
29+
contentManager.setSelectedContent(content)
3030

3131
toolWindowManager.activate {
3232
runnable(contentPanel, chatCodingService)

core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewChatAction.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class NewChatAction : DumbAwareAction(), CustomComponentAction {
4545
return@addActionListener
4646
}
4747

48-
contentManager.contents.filter { it.component is ChatCodingPanel }.forEach {
49-
AutoDevToolWindowFactory.setInitialDisplayName(it)
50-
}
48+
// contentManager.contents.filter { it.component is ChatCodingPanel }.forEach {
49+
// AutoDevToolWindowFactory.setInitialDisplayName(it)
50+
// }
5151

5252
codingPanel.resetChatSession()
5353
}

0 commit comments

Comments
 (0)