diff --git a/src/actions/index.js b/src/actions/index.js index 5352f20..44be864 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -247,7 +247,7 @@ export function updateNarrative (narrative) { } export const UPDATE_NARRATIVE_STEP_IDX = 'UPDATE_NARRATIVE_STEP_IDX' -export function selectNarrativeIdx (idx) { +export function updateNarrativeStepIdx (idx) { return { type: UPDATE_NARRATIVE_STEP_IDX, idx diff --git a/src/components/Layout.js b/src/components/Layout.js index cfbe7b1..e6c794b 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -179,8 +179,6 @@ class Dashboard extends React.Component { selectNarrativeStep (idx) { // Try to find idx if event passed rather than number if (typeof idx !== 'number') { - console.log('run') - console.log(idx) let e = idx[0] || idx if (this.props.app.narrative) { @@ -192,13 +190,10 @@ class Dashboard extends React.Component { if (narrativeIdx > -1) { idx = narrativeIdx - console.log(idx) } } } - console.log(idx) - const { narrative } = this.props.app if (narrative === null) return @@ -206,7 +201,7 @@ class Dashboard extends React.Component { const step = narrative.steps[idx] this.handleSelect([step]) - this.props.actions.selectNarrativeIdx(idx) + this.props.actions.updateNarrativeStepIdx(idx) } } diff --git a/src/reducers/app.js b/src/reducers/app.js index 9a36058..5c92fbc 100644 --- a/src/reducers/app.js +++ b/src/reducers/app.js @@ -98,12 +98,10 @@ function updateNarrative (appState, action) { } function updateNarrativeStepIdx (appState, action) { - appState.narrativeState.current = action.idx - return { ...appState, narrativeState: { - current: appState.narrativeState.current + current: action.idx } } }