Skip to content

Commit

Permalink
feat(protocol-designer): collapse all step items on newly loaded file
Browse files Browse the repository at this point in the history
Closes #2541
  • Loading branch information
IanLondon committed Oct 24, 2018
1 parent c6a9f38 commit 524c1a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions protocol-designer/src/steplist/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ const collapsedSteps: Reducer<CollapsedStepsState, *> = handleActions({
...state,
[payload]: !state[payload],
}),
LOAD_FILE: (state: CollapsedStepsState, action: LoadFileAction) =>
// default all steps to collapsed
getPDMetadata(action.payload).orderedSteps.reduce(
(acc: CollapsedStepsState, stepId) => ({...acc, [stepId]: true}),
{}
),
}, {})

export type OrderedStepsState = Array<StepIdType>
Expand Down

0 comments on commit 524c1a5

Please sign in to comment.