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

cleanup cluster views on unmount

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-06-04 11:27:33 +03:00
parent e7086a66d1
commit fce49696f4

View File

@ -66,6 +66,10 @@ export class ClusterView extends React.Component<Props> {
this.bindEvents();
}
componentWillUnmount() {
refreshViews();
}
bindEvents() {
disposeOnUnmount(this, [
reaction(() => this.clusterId, async (clusterId) => {
@ -81,7 +85,6 @@ export class ClusterView extends React.Component<Props> {
const disconnected = values[1];
if (hasLoadedView(this.clusterId) && disconnected) {
refreshViews();
navigate(catalogURL()); // redirect to catalog when active cluster get disconnected/not available
}
}),