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

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 2020-08-12 15:24:28 +03:00 committed by Lauri Nevala
parent e7d4317b6e
commit 7903ebaac8

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));
}
}