From d5ba6dfe79aab302850a736a180ef6a4f458d5ed Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Fri, 29 Jan 2021 12:32:14 +0200 Subject: [PATCH] ensure cluster view is active before sending a command Signed-off-by: Jari Kolehmainen --- src/renderer/components/command-palette/command-dialog.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/renderer/components/command-palette/command-dialog.tsx b/src/renderer/components/command-palette/command-dialog.tsx index ba6b7c2f15..a8b0965488 100644 --- a/src/renderer/components/command-palette/command-dialog.tsx +++ b/src/renderer/components/command-palette/command-dialog.tsx @@ -8,6 +8,8 @@ import { clusterStore } from "../../../common/cluster-store"; import { workspaceStore } from "../../../common/workspace-store"; import { CommandOverlay } from "./command-container"; import { broadcastMessage } from "../../../common/ipc"; +import { navigate } from "../../navigation"; +import { clusterViewURL } from "../cluster-manager/cluster-view.route"; @observer export class CommandDialog extends React.Component { @@ -58,6 +60,11 @@ export class CommandDialog extends React.Component { workspace: workspaceStore.currentWorkspace }); } else if(clusterStore.active) { + navigate(clusterViewURL({ + params: { + clusterId: clusterStore.active.id + } + })); broadcastMessage(`command-palette:run-action:${clusterStore.active.id}`, command.id); } } catch(error) {