From 6320e5c91f64f5ca92733c63b4228142923d3851 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Thu, 23 Apr 2020 22:10:08 +0200 Subject: [PATCH] NewPanelEditor: bring back queries not being run on editmode navigation (#23837) --- .../dashboard/state/DashboardModel.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/public/app/features/dashboard/state/DashboardModel.ts b/public/app/features/dashboard/state/DashboardModel.ts index ceb347f7021..f38b3117b92 100644 --- a/public/app/features/dashboard/state/DashboardModel.ts +++ b/public/app/features/dashboard/state/DashboardModel.ts @@ -315,14 +315,18 @@ export class DashboardModel { panelInitialized(panel: PanelModel) { panel.initialized(); - // refresh new panels unless we are in fullscreen / edit mode - if (!this.otherPanelInFullscreen(panel)) { - panel.refresh(); - } - - // refresh if panel is in edit mode and there is no last result - if (this.panelInEdit === panel && !this.panelInEdit.getQueryRunner().getLastResult()) { - panel.refresh(); + if (this.panelInEdit === panel) { + if (this.panelInEdit.getQueryRunner().getLastResult()) { + return; + } else { + // refresh if panel is in edit mode and there is no last result + panel.refresh(); + } + } else { + // refresh new panels unless we are in fullscreen / edit mode + if (!this.otherPanelInFullscreen(panel)) { + panel.refresh(); + } } }