revering user-store refactoring

Signed-off-by: Roman <ixrock@gmail.com>
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Roman authored and Lauri Nevala committed 2020-08-18 12:02:26 +03:00
1 parent e7d4317b6e
commit 7903ebaac8
1 file changed
+4 -6
+4 -6
View File
@@ -71,12 +71,10 @@ export class UserStore extends BaseStore<UserStoreModel> {
if (kubeConfig) {
this.newContexts.clear();
const localContexts = loadConfig(kubeConfig).getContexts();
localContexts.forEach(({ cluster, name }) => {
if (!cluster) return;
if (!this.seenContexts.has(name)) {
this.newContexts.add(name)
}
})
localContexts
.filter(ctx => ctx.cluster)
.filter(ctx => !this.seenContexts.has(ctx.name))
.forEach(ctx => this.newContexts.add(ctx.name));
}
}