ensure cluster view is active before sending a command

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2021-01-29 12:32:14 +02:00
1 parent 92e30ddaa2
commit d5ba6dfe79
1 file changed
+7
@@ -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) {