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

Cleanup cluster views on unmount (#2961)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-06-04 15:51:41 +03:00 committed by GitHub
parent 573a635e29
commit a411f4cfe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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