mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
ddf45c2025
commit
62e0f575c7
4 files changed
+25
-38
No files matched your search
@@ -39,9 +39,7 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
isAllowedResource("events") && eventStore,
|
||||
].filter(Boolean);
|
||||
|
||||
const unsubscribeMap = new Map<KubeObjectStore, Function>(
|
||||
stores.map(store => [store, Function])
|
||||
);
|
||||
const unsubscribeMap = new Map<KubeObjectStore, () => void>();
|
||||
|
||||
const loadStores = async () => {
|
||||
this.isLoading = true;
|
||||
@@ -52,7 +50,7 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
try {
|
||||
store.reset();
|
||||
await store.loadAll();
|
||||
unsubscribeMap.get(store)(); // unsubscribe previous watcher
|
||||
unsubscribeMap.get(store)?.(); // unsubscribe previous watcher
|
||||
unsubscribeMap.set(store, store.subscribe());
|
||||
} catch (error) {
|
||||
console.error("loading store error", error);
|
||||
|
||||
Reference in new issue
Block a user