console logs removed and changes made

This commit is contained in:
Sol
2020-08-03 18:51:35 +01:00
committed by Lachlan Kermode
parent 8e4ca6b8fc
commit 19201a5808
3 changed files with 3 additions and 10 deletions

View File

@@ -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

View File

@@ -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)
}
}

View File

@@ -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
}
}
}