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

Register existing store with new apiBase when re-registering Kube API (#2157)

* Update store key after api's apiBase change

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>

* Re-register existing store when registering API

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>

* Revert kube-api changes

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2021-02-16 14:49:51 +02:00 committed by GitHub
parent 1e5d682b9b
commit 3f2d912816
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,12 @@ export class ApiManager {
registerApi(apiBase: string, api: KubeApi) { registerApi(apiBase: string, api: KubeApi) {
if (!this.apis.has(apiBase)) { if (!this.apis.has(apiBase)) {
this.stores.forEach((store) => {
if(store.api === api) {
this.stores.set(apiBase, store);
}
});
this.apis.set(apiBase, api); this.apis.set(apiBase, api);
} }
} }