mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix CRDs not updating in Sidebar (#4288)
This commit is contained in:
1 parent
333d77f66a
commit
673f20fb74
3 files changed
+19
-10
No files matched your search
@@ -36,10 +36,12 @@ import { kubeSelectedUrlParam, toggleDetails } from "../kube-detail-params";
|
||||
export interface KubeObjectListLayoutProps<K extends KubeObject> extends ItemListLayoutProps<K> {
|
||||
store: KubeObjectStore<K>;
|
||||
dependentStores?: KubeObjectStore<KubeObject>[];
|
||||
subscribeStores?: boolean;
|
||||
}
|
||||
|
||||
const defaultProps: Partial<KubeObjectListLayoutProps<KubeObject>> = {
|
||||
onDetails: (item: KubeObject) => toggleDetails(item.selfLink),
|
||||
subscribeStores: true,
|
||||
};
|
||||
|
||||
@observer
|
||||
@@ -56,15 +58,17 @@ export class KubeObjectListLayout<K extends KubeObject> extends React.Component<
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { store, dependentStores = [] } = this.props;
|
||||
const { store, dependentStores = [], subscribeStores } = this.props;
|
||||
const stores = Array.from(new Set([store, ...dependentStores]));
|
||||
|
||||
disposeOnUnmount(this, [
|
||||
kubeWatchApi.subscribeStores(stores, {
|
||||
preload: true,
|
||||
namespaces: clusterContext.contextNamespaces,
|
||||
}),
|
||||
]);
|
||||
if (subscribeStores) {
|
||||
disposeOnUnmount(this, [
|
||||
kubeWatchApi.subscribeStores(stores, {
|
||||
preload: true,
|
||||
namespaces: clusterContext.contextNamespaces,
|
||||
}),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in new issue
Block a user