mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Delay removing iframe to fix renderer crash (#6952)
Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
d3a3d7234a
commit
8ace84f7e7
@ -88,7 +88,15 @@ export class ClusterFrameHandler {
|
|||||||
() => {
|
() => {
|
||||||
this.dependencies.logger.info(`[LENS-VIEW]: remove dashboard, clusterId=${clusterId}`);
|
this.dependencies.logger.info(`[LENS-VIEW]: remove dashboard, clusterId=${clusterId}`);
|
||||||
this.views.delete(clusterId);
|
this.views.delete(clusterId);
|
||||||
parentElem.removeChild(iframe);
|
|
||||||
|
// Must only remove iframe from DOM after it unloads old code. Else it crashes
|
||||||
|
iframe.addEventListener("load", () => parentElem.removeChild(iframe), {
|
||||||
|
once: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
// This causes the old code to be unloaded.
|
||||||
|
iframe.setAttribute("src", "");
|
||||||
|
|
||||||
dispose();
|
dispose();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user