From 516e4d2bc382b2fe23cc678d3f06da69e02b4235 Mon Sep 17 00:00:00 2001 From: "Mr.Dr.Professor Patrick" Date: Fri, 10 Jan 2025 15:12:01 +0100 Subject: [PATCH] Add dataset tab changing to edit history (#1995) --- .../datasets/store/actions/creators/datasetTyped.ts | 12 ++++++++++-- src/ui/units/datasets/store/types/dataset.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ui/units/datasets/store/actions/creators/datasetTyped.ts b/src/ui/units/datasets/store/actions/creators/datasetTyped.ts index 60c3be66bd..7c27fab3e6 100644 --- a/src/ui/units/datasets/store/actions/creators/datasetTyped.ts +++ b/src/ui/units/datasets/store/actions/creators/datasetTyped.ts @@ -1008,9 +1008,17 @@ export function addEditHistoryPointDs({stacked}: EditHistoryOptions = {}) { }; } -export function setCurrentTab(payload: SetCurrentTab['payload']): SetCurrentTab { +export function setCurrentTab({ + currentTab, + [EDIT_HISTORY_OPTIONS_KEY]: editHistoryOptions, +}: SetCurrentTab['payload']): SetCurrentTab { return { type: DATASET_ACTION_TYPES.SET_CURRENT_TAB, - payload, + payload: { + currentTab, + [EDIT_HISTORY_OPTIONS_KEY]: { + ...editHistoryOptions, + }, + }, }; } diff --git a/src/ui/units/datasets/store/types/dataset.ts b/src/ui/units/datasets/store/types/dataset.ts index 008cfb1f54..0809b31cbb 100644 --- a/src/ui/units/datasets/store/types/dataset.ts +++ b/src/ui/units/datasets/store/types/dataset.ts @@ -767,7 +767,7 @@ export type SetCurrentTab = { type: typeof SET_CURRENT_TAB; payload: { currentTab: DatasetTab; - }; + } & EditHistoryOptionsProperty; }; export type DatasetReduxAction =