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

Resolve PR comments

- load errors now are paragraph spaced

- The loading warning stays around when switching to all namespaces

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-11-15 10:23:10 -05:00
parent 373476fb03
commit 28b9e2cbc1
2 changed files with 3 additions and 2 deletions

View File

@ -60,7 +60,7 @@ interface KubeWatchPreloadOptions {
export interface KubeWatchSubscribeStoreOptions extends KubeWatchPreloadOptions { export interface KubeWatchSubscribeStoreOptions extends KubeWatchPreloadOptions {
/** /**
* Whether to subsribe only after loading all stores * Whether to subscribe only after loading all stores
* @default true * @default true
*/ */
waitUntilLoaded?: boolean; waitUntilLoaded?: boolean;

View File

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