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

keep only items from non-loaded namespaces

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-02-11 08:16:43 +02:00
parent 819b404fc0
commit 71c2bc69d9

View File

@ -178,10 +178,10 @@ export abstract class KubeObjectStore<T extends KubeObject = any> extends ItemSt
// update existing items
if (!replace) {
const partialIds = partialItems.map(item => item.getId());
const namespaces = partialItems.map(item => item.getNs());
items = [
...this.items.filter(existingItem => !partialIds.includes(existingItem.getId())),
...this.items.filter(existingItem => !namespaces.includes(existingItem.getNs())),
...partialItems,
];
}