Skip to content

Commit

Permalink
5.8.0Ж toolbar action fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
smklimenko committed Jun 27, 2024
1 parent 6c94455 commit 79bd9a1
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ public static boolean isExecutedAllowed(AnActionEvent e) {
@Override
public void update(@NotNull AnActionEvent e) {
final Presentation presentation = e.getPresentation();
final Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext());
if (editor == null) {
presentation.setEnabled(false);
presentation.setVisible(false);
} else if (org.kdb.inside.brains.action.ActionPlaces.KEYBOARD_SHORTCUT.equals(e.getPlace())) {
if (org.kdb.inside.brains.action.ActionPlaces.KEYBOARD_SHORTCUT.equals(e.getPlace())) {
presentation.setEnabled(true);
presentation.setVisible(false);
} else {
Expand All @@ -58,7 +54,8 @@ public void update(@NotNull AnActionEvent e) {
presentation.setVisible(allowed);
}

if (allowed) {
final Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext());
if (allowed && editor != null) {
final InstanceConnection activeInstance = getConnection(e.getProject());
presentation.setEnabled(activeInstance != null && activeInstance.isConnected());
} else {
Expand Down

0 comments on commit 79bd9a1

Please sign in to comment.