fix(SaveModal): reset chart state when saving and going to a dashboard (#36402)

This commit is contained in:
Mehmet Salih Yavuz
2025-12-03 18:30:08 +03:00
committed by GitHub
parent f955f0d133
commit b40467c7e2
2 changed files with 86 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ import { canUserEditDashboard } from 'src/dashboard/util/permissionUtils';
import { setSaveChartModalVisibility } from 'src/explore/actions/saveModalActions';
import { SaveActionType } from 'src/explore/types';
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
import { removeChartState } from 'src/dashboard/actions/dashboardState';
import { Dashboard } from 'src/types/Dashboard';
// Session storage key for recent dashboard
@@ -276,6 +277,7 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
// Go to new dashboard url
if (gotodash && dashboard) {
this.props.dispatch(removeChartState(value.id));
this.props.history.push(dashboard.url);
return;
}