Skip to content

Commit

Permalink
fix: fix issues of internal API
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Aug 5, 2023
1 parent 44280bb commit d3e56ab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewChatAction.kt
Expand Up @@ -26,16 +26,16 @@ class NewChatAction : DumbAwareAction(), CustomComponentAction {
val button: JButton = object : JButton(message) {
init {
putClientProperty("ActionToolbar.smallVariant", true)
putClientProperty("customButtonInsets", JBInsets(1).asUIResource())
putClientProperty("customButtonInsets", JBInsets(1, 1, 1, 1).asUIResource())
setOpaque(false)
addActionListener { event: ActionEvent? ->
addActionListener {
val project = ProjectManager.getInstance().openProjects.firstOrNull() ?: return@addActionListener
val toolWindowManager = ToolWindowManager.getInstance(project).getToolWindow(
AutoDevToolWindowFactory.Util.id)
AutoDevToolWindowFactory.Util.id
)
val contentManager = toolWindowManager?.contentManager
contentManager?.component?.components?.filterIsInstance<ChatCodingPanel>()?.firstOrNull()?.let {
it.clearChat()
}
contentManager?.component?.components?.filterIsInstance<ChatCodingPanel>()?.firstOrNull()
?.clearChat()
}
}
}
Expand Down

0 comments on commit d3e56ab

Please sign in to comment.