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:
parent
4beedb5f69
commit
8fc6fdff17
1 changed files with 5 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue