From 984d2da9aeebad30de91a8d7162ea9cc058b796c Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:48:53 +0000 Subject: [PATCH] LibraryPanels: Fix issue with repeated library panels (#82255) Fixes an issue where a library panel being repeated by a template variable would briefly use the All value for the first repeat instance --- public/app/features/panel/state/actions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/app/features/panel/state/actions.ts b/public/app/features/panel/state/actions.ts index 2e01dd5a732..c326cf812ae 100644 --- a/public/app/features/panel/state/actions.ts +++ b/public/app/features/panel/state/actions.ts @@ -147,15 +147,16 @@ export function loadLibraryPanelAndUpdate(panel: PanelModel): ThunkResult try { const libPanel = await getLibraryPanel(uid, true); panel.initLibraryPanel(libPanel); - await dispatch(initPanelState(panel)); - const dashboard = getStore().dashboard.getModel(); + const dashboard = getStore().dashboard.getModel(); if (panel.repeat && dashboard) { const panelIndex = dashboard.panels.findIndex((p) => p.id === panel.id); dashboard.repeatPanel(panel, panelIndex); dashboard.sortPanelsByGridPos(); dashboard.events.publish(new DashboardPanelsChangedEvent()); } + + await dispatch(initPanelState(panel)); } catch (ex) { console.log('ERROR: ', ex); dispatch(