1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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 2021-01-29 12:32:14 +02:00
parent 92e30ddaa2
commit d5ba6dfe79

View File

@ -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) {