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

show catalog if viewed cluster is disconnected

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-04-08 15:21:17 +03:00
parent 6061075525
commit 491aa173ae

View File

@ -8,6 +8,8 @@ import { ClusterStatus } from "./cluster-status";
import { hasLoadedView } from "./lens-views";
import { Cluster } from "../../../main/cluster";
import { clusterStore } from "../../../common/cluster-store";
import { navigate } from "../../navigation";
import { catalogURL } from "../+catalog";
interface Props extends RouteComponentProps<IClusterViewRouteParams> {
}
@ -26,6 +28,9 @@ export class ClusterView extends React.Component<Props> {
disposeOnUnmount(this, [
reaction(() => this.clusterId, clusterId => clusterStore.setActive(clusterId), {
fireImmediately: true,
}),
reaction(() => this.cluster.online, (online) => {
if (!online) navigate(catalogURL());
})
]);
}