Panels: Fixes crashing issue when migrating angular panels (#58232)

This commit is contained in:
Torkel Ödegaard
2022-11-08 16:26:02 +01:00
committed by GitHub
parent 25f79ef2b9
commit 50a197014f
7 changed files with 18 additions and 67 deletions

View File

@@ -66,10 +66,9 @@ export function updateDuplicateLibraryPanels(
panel.configRev++;
if (pluginChanged) {
const cleanUpKey = panel.key;
panel.generateNewKey();
dispatch(panelModelAndPluginReady({ key: panel.key, plugin: panel.plugin!, cleanUpKey }));
dispatch(panelModelAndPluginReady({ key: panel.key, plugin: panel.plugin! }));
}
// Resend last query result on source panel query runner
@@ -129,10 +128,9 @@ export function exitPanelEditor(): ThunkResult<void> {
if (panelTypeChanged) {
// Loaded plugin is not included in the persisted properties so is not handled by restoreModel
sourcePanel.plugin = panel.plugin;
const cleanUpKey = sourcePanel.key;
sourcePanel.generateNewKey();
await dispatch(panelModelAndPluginReady({ key: sourcePanel.key, plugin: panel.plugin!, cleanUpKey }));
await dispatch(panelModelAndPluginReady({ key: sourcePanel.key, plugin: panel.plugin! }));
}
// Resend last query result on source panel query runner