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:
parent
573a635e29
commit
a411f4cfe5
@ -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
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user