mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix for annotations not clearing when switching dashboards, fixes #15063
This commit is contained in:
parent
2bed762950
commit
c3c8cd3f4d
@ -21,12 +21,16 @@ export class AnnotationsSrv {
|
||||
constructor(private $rootScope, private $q, private datasourceSrv, private backendSrv, private timeSrv) {}
|
||||
|
||||
init(dashboard: DashboardModel) {
|
||||
// always clearPromiseCaches when loading new dashboard
|
||||
this.clearPromiseCaches();
|
||||
// clear promises on refresh events
|
||||
dashboard.on('refresh', () => {
|
||||
dashboard.on('refresh', this.clearPromiseCaches.bind(this));
|
||||
}
|
||||
|
||||
clearPromiseCaches() {
|
||||
this.globalAnnotationsPromise = null;
|
||||
this.alertStatesPromise = null;
|
||||
this.datasourcePromises = null;
|
||||
});
|
||||
}
|
||||
|
||||
getAnnotations(options) {
|
||||
|
Loading…
Reference in New Issue
Block a user