Commit 945b815f by Andrej Ocenas Committed by GitHub

Fix: Unsubscribe from events in dashboards (#19788)

* Unsubscribe on unmount

* Fix unsubscribe
parent f8c474fa
......@@ -81,6 +81,8 @@ export class PanelChrome extends PureComponent<Props, State> {
componentWillUnmount() {
this.props.panel.events.off(PanelEvents.refresh, this.onRefresh);
this.props.panel.events.off(PanelEvents.render, this.onRender);
if (this.querySubscription) {
this.querySubscription.unsubscribe();
this.querySubscription = null;
......
......@@ -151,6 +151,9 @@ export class VisualizationTab extends PureComponent<Props, State> {
}
componentWillUnmount() {
if (this.querySubscription) {
this.querySubscription.unsubscribe();
}
this.cleanUpAngularOptions();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment