From c6dd19f1639736f73df7ad2ff44ca061b55d33b5 Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Wed, 12 May 2021 09:42:17 +0100 Subject: [PATCH] Library Panels: Fix error when changing viz of panel with multiple instances (#33915) --- .../dashboard/components/PanelEditor/state/actions.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app/features/dashboard/components/PanelEditor/state/actions.ts b/public/app/features/dashboard/components/PanelEditor/state/actions.ts index bde2d105533..b0b23b6681a 100644 --- a/public/app/features/dashboard/components/PanelEditor/state/actions.ts +++ b/public/app/features/dashboard/components/PanelEditor/state/actions.ts @@ -104,9 +104,11 @@ function updateDuplicateLibraryPanels(modifiedPanel: PanelModel, dashboard: Dash // Loaded plugin is not included in the persisted properties // So is not handled by restoreModel - panel.plugin = modifiedSaveModel.plugin; + const pluginChanged = panel.plugin?.meta.id !== modifiedPanel.plugin?.meta.id; + panel.plugin = modifiedPanel.plugin; + panel.configRev++; - if (panel.type !== modifiedPanel.type) { + if (pluginChanged) { dispatch(panelModelAndPluginReady({ panelId: panel.id, plugin: panel.plugin! })); }