Skip to content

Commit

Permalink
DATAP-1341 - Restore row chart functionality on map tab (#523)
Browse files Browse the repository at this point in the history
* 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 <chanel.henley@cfpb.gov>
  • Loading branch information
cdmh219 and cdhenley219 authored Aug 2, 2024
1 parent 955be8c commit 1049e64
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/reducers/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 1049e64

Please sign in to comment.