mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix trying to connect to cluster whose entity doesn't exist (#5881)
* Fix trying to connect to cluster whose entity doesn't exist - If a Cluster is trying to be connected to but there is no associated entity then don't try and connect Signed-off-by: Sebastian Malton <sebastian@malton.name> * Revert cleanup Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
91235ca2c6
commit
e7e8d1688c
@ -68,6 +68,11 @@ class NonInjectedClusterView extends React.Component<Dependencies> {
|
||||
bindEvents() {
|
||||
disposeOnUnmount(this, [
|
||||
reaction(() => this.clusterId, async (clusterId) => {
|
||||
// TODO: replace with better handling
|
||||
if (clusterId && !this.props.entityRegistry.getById(clusterId)) {
|
||||
return this.props.navigateToCatalog(); // redirect to catalog when the clusterId does not correspond to an entity
|
||||
}
|
||||
|
||||
this.props.clusterFrames.setVisibleCluster(clusterId);
|
||||
this.props.clusterFrames.initView(clusterId);
|
||||
requestClusterActivation(clusterId, false); // activate and fetch cluster's state from main
|
||||
|
||||
Loading…
Reference in New Issue
Block a user