Cleanup cluster views on unmount (#2961)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2021-06-04 08:51:41 -04:00
1 parent 573a635e29
commit a411f4cfe5
1 file changed
+4 -1
@@ -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
}
}),