From 1049e6457d1e4caea03ebf527ac1916cfad8e993 Mon Sep 17 00:00:00 2001 From: Chanel Henley <129774390+cdmh219@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:12:24 -0400 Subject: [PATCH] DATAP-1341 - Restore row chart functionality on map tab (#523) * Made fix to use immutable functionality to add new items to the expandedRows part of the Redux store * Updated based on PR feedback --------- Co-authored-by: cdhenley219 --- src/reducers/view/view.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/reducers/view/view.js b/src/reducers/view/view.js index 6e5ba51ef..ec51131b6 100644 --- a/src/reducers/view/view.js +++ b/src/reducers/view/view.js @@ -196,15 +196,18 @@ export function collapseRow(state, action) { export function expandRow(state, action) { const { expandedRows } = state; const item = action.value; + let newState; if (!expandedRows.includes(item)) { - expandedRows.push(item); + newState = { + ...state, + expandedRows: [...expandedRows, item], + }; + } else { + newState = { ...state }; } - return { - ...state, - expandedRows, - }; + return newState; } /**