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

Load releases for all namespaces at once

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-02-12 15:58:53 +03:00
parent d40bd0c7d0
commit ca518c7f55

View File

@ -78,9 +78,15 @@ export class ReleaseStore extends ItemStore<HelmRelease> {
}
async loadItems(namespaces: string[]) {
return Promise
.all(namespaces.map(namespace => helmReleasesApi.list(namespace)))
.then(items => items.flat());
const isLoadingAll = namespaceStore.allowedNamespaces.every(ns => namespaces.includes(ns));
if (isLoadingAll) {
return helmReleasesApi.list();
} else {
return Promise
.all(namespaces.map(namespace => helmReleasesApi.list(namespace)))
.then(items => items.flat());
}
}
async create(payload: IReleaseCreatePayload) {