fix corner cases in narrative left/right

This commit is contained in:
Lachlan Kermode
2020-06-26 16:37:52 +02:00
parent 79d2acec22
commit 5db2305baf

View File

@@ -170,11 +170,11 @@ class Dashboard extends React.Component {
const { narrative } = this.props.app
if (narrative === null) return
if (amt === 1) {
if (amt === 1 && current < narrative.steps.length - 1) {
this.handleSelect([ narrative.steps[current + 1] ])
this.props.actions.incrementNarrativeCurrent()
}
if (amt === -1) {
if (amt === -1 && current > 0) {
this.handleSelect([ narrative.steps[current - 1] ])
this.props.actions.decrementNarrativeCurrent()
}