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

Fix strangeness when switching between single namespaces

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-11-19 15:53:34 -05:00
parent c9e0967650
commit 7a71127d3c
2 changed files with 8 additions and 7 deletions

View File

@ -61,7 +61,7 @@ export class WorkloadsOverview extends React.Component<Props> {
], {
onLoadFailure: error => this.loadErrors.push(String(error)),
}),
reaction(() => clusterContext.contextNamespaces.length, () => {
reaction(() => clusterContext.contextNamespaces.slice(), () => {
// clear load errors
this.loadErrors.length = 0;
}),
@ -90,11 +90,12 @@ export class WorkloadsOverview extends React.Component<Props> {
}
render() {
const items = WorkloadsOverviewDetailRegistry.getInstance().getItems().map((item, index) => {
return (
<item.components.Details key={`workload-overview-${index}`}/>
);
});
const items = WorkloadsOverviewDetailRegistry
.getInstance()
.getItems()
.map(({ components: { Details }}, index) => (
<Details key={`workload-overview-${index}`}/>
));
return (
<div className="WorkloadsOverview flex column gaps">

View File

@ -67,7 +67,7 @@ export class KubeObjectListLayout<K extends KubeObject> extends React.Component<
const { store, dependentStores = [], subscribeStores } = this.props;
const stores = Array.from(new Set([store, ...dependentStores]));
const reactions: Disposer[] = [
reaction(() => clusterContext.contextNamespaces.length, () => {
reaction(() => clusterContext.contextNamespaces.slice(), () => {
// clear load errors
this.loadErrors.length = 0;
}),