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
This commit is contained in:
kay delaney 2024-02-09 13:48:53 +00:00 committed by GitHub
parent fc5f228675
commit 984d2da9ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -147,15 +147,16 @@ export function loadLibraryPanelAndUpdate(panel: PanelModel): ThunkResult<void>
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(