Skip to content

Commit

Permalink
fix crd resources watch issue (#3520)
Browse files Browse the repository at this point in the history
Signed-off-by: Jari Kolehmainen <[email protected]>
  • Loading branch information
jakolehm authored Jul 27, 2021
1 parent 1b11433 commit e43961e
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/renderer/components/+custom-resources/crd-resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;

Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit e43961e

Please sign in to comment.