Dashboard: Fix for overwriting an edited dashboard in the old architecture (#100247)

This commit is contained in:
Bogdan Matei
2025-02-07 16:44:55 +02:00
committed by GitHub
parent 53030e7960
commit 158c5443b5

View File

@@ -1,3 +1,4 @@
import { cloneDeep } from 'lodash';
import { useAsyncFn } from 'react-use';
import { locationUtil } from '@grafana/data';
@@ -46,6 +47,8 @@ export const useDashboardSave = (isCopy = false) => {
const result = await saveDashboard(clone, options, dashboard, saveDashboardRtkQuery);
dashboard.version = result.version;
// Altering the clone leads to an error due to the clone being immutable
clone = cloneDeep(clone);
clone.version = result.version;
dashboard.clearUnsavedChanges(clone, options);