1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-09 15:55:23 +02:00

fix namespace refresh flag issue

This commit is contained in:
Prabhat Khera 2023-03-13 09:30:01 +13:00
parent 4beedb5f69
commit 8fc6fdff17

View file

@ -85,17 +85,15 @@ class KubernetesNamespaceService {
if (name) {
return this.$async(this.getAsync, name);
}
if (!refreshCache) {
const cachedAllowedNamespaces = this.LocalStorage.getAllowedNamespaces();
if (cachedAllowedNamespaces) {
updateNamespaces(cachedAllowedNamespaces);
return cachedAllowedNamespaces;
}
} else {
const cachedAllowedNamespaces = this.LocalStorage.getAllowedNamespaces();
if (!cachedAllowedNamespaces || refreshCache) {
const allowedNamespaces = await this.getAllAsync();
this.LocalStorage.storeAllowedNamespaces(allowedNamespaces);
updateNamespaces(allowedNamespaces);
return allowedNamespaces;
} else {
updateNamespaces(cachedAllowedNamespaces);
return cachedAllowedNamespaces;
}
}