From 28b9e2cbc18276b335fb297d25698585d993b914 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 15 Nov 2021 10:23:10 -0500 Subject: [PATCH] Resolve PR comments - load errors now are paragraph spaced - The loading warning stays around when switching to all namespaces Signed-off-by: Sebastian Malton --- src/common/k8s-api/kube-watch-api.ts | 2 +- .../kube-object-list-layout/kube-object-list-layout.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/k8s-api/kube-watch-api.ts b/src/common/k8s-api/kube-watch-api.ts index 7d0df2914f..116e8777be 100644 --- a/src/common/k8s-api/kube-watch-api.ts +++ b/src/common/k8s-api/kube-watch-api.ts @@ -60,7 +60,7 @@ interface KubeWatchPreloadOptions { export interface KubeWatchSubscribeStoreOptions extends KubeWatchPreloadOptions { /** - * Whether to subsribe only after loading all stores + * Whether to subscribe only after loading all stores * @default true */ waitUntilLoaded?: boolean; diff --git a/src/renderer/components/kube-object-list-layout/kube-object-list-layout.tsx b/src/renderer/components/kube-object-list-layout/kube-object-list-layout.tsx index d6021f776d..9daf2f797f 100644 --- a/src/renderer/components/kube-object-list-layout/kube-object-list-layout.tsx +++ b/src/renderer/components/kube-object-list-layout/kube-object-list-layout.tsx @@ -66,7 +66,7 @@ export class KubeObjectListLayout extends React.Component< const { store, dependentStores = [], subscribeStores } = this.props; const stores = Array.from(new Set([store, ...dependentStores])); const reactions: Disposer[] = [ - reaction(() => clusterContext.contextNamespaces, () => { + reaction(() => clusterContext.contextNamespaces.length, () => { // clear load errors this.loadErrors.length = 0; }), @@ -77,6 +77,7 @@ export class KubeObjectListLayout extends React.Component< kubeWatchApi.subscribeStores(stores, { preload: true, namespaces: clusterContext.contextNamespaces, + onLoadFailure: error => this.loadErrors.push(error), }), ); }