mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-19 07:54:46 +00:00
fix: chat reset button state when current conversation not properly configured (fixes #651)
This commit is contained in:
parent
2a0747f923
commit
1afbc4de85
1 changed files with 2 additions and 11 deletions
|
|
@ -2,15 +2,14 @@ package ee.carlrobert.codegpt.actions.toolwindow;
|
|||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import ee.carlrobert.codegpt.actions.ActionType;
|
||||
import ee.carlrobert.codegpt.actions.editor.EditorActionsUtil;
|
||||
import ee.carlrobert.codegpt.conversations.ConversationsState;
|
||||
import ee.carlrobert.codegpt.telemetry.TelemetryAction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ClearChatWindowAction extends AnAction {
|
||||
public class ClearChatWindowAction extends DumbAwareAction {
|
||||
|
||||
private final Runnable onActionPerformed;
|
||||
|
||||
|
|
@ -20,14 +19,6 @@ public class ClearChatWindowAction extends AnAction {
|
|||
EditorActionsUtil.registerAction(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent event) {
|
||||
super.update(event);
|
||||
var currentConversation = ConversationsState.getCurrentConversation();
|
||||
var isEnabled = currentConversation != null && !currentConversation.getMessages().isEmpty();
|
||||
event.getPresentation().setEnabled(isEnabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent event) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue