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

fix crd resources watch issue (#3520)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-07-27 20:12:25 +03:00 committed by GitHub
parent 1b11433bca
commit e43961ec4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,11 +23,11 @@ import "./crd-resources.scss";
import React from "react";
import jsonPath from "jsonpath";
import { disposeOnUnmount, observer } from "mobx-react";
import { observer } from "mobx-react";
import type { RouteComponentProps } from "react-router";
import { KubeObjectListLayout } from "../kube-object";
import type { KubeObject } from "../../api/kube-object";
import { autorun, computed, makeObservable } from "mobx";
import { computed, makeObservable } from "mobx";
import { crdStore } from "./crd.store";
import type { TableSortCallbacks } from "../table";
import { apiManager } from "../../api/api-manager";
@ -50,18 +50,6 @@ export class CrdResources extends React.Component<Props> {
makeObservable(this);
}
componentDidMount() {
disposeOnUnmount(this, [
autorun(() => {
const { store } = this;
if (store && !store.isLoading && !store.isLoaded) {
store.reloadAll();
}
})
]);
}
@computed get crd() {
const { group, name } = this.props.match.params;
@ -93,6 +81,7 @@ export class CrdResources extends React.Component<Props> {
return (
<KubeObjectListLayout
isConfigurable
key={`crd_resources_${crd.getResourceApiBase()}`}
tableId="crd_resources"
className="CrdResources"
store={store}