mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Cleanup iframe when cluster is disconnected (#2120)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
d7d4be7375
commit
f14f3b3287
@ -40,7 +40,15 @@ export async function initView(clusterId: ClusterId) {
|
||||
}
|
||||
|
||||
export async function autoCleanOnRemove(clusterId: ClusterId, iframe: HTMLIFrameElement) {
|
||||
await when(() => !clusterStore.getById(clusterId));
|
||||
await when(() => {
|
||||
const cluster = clusterStore.getById(clusterId);
|
||||
|
||||
if (!cluster) return true;
|
||||
|
||||
const view = lensViews.get(clusterId);
|
||||
|
||||
return cluster.disconnected && view?.isLoaded;
|
||||
});
|
||||
logger.info(`[LENS-VIEW]: remove dashboard, clusterId=${clusterId}`);
|
||||
lensViews.delete(clusterId);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user