Skip to content

Commit

Permalink
Fixed a bug where enabling a die would enable the lock section too al…
Browse files Browse the repository at this point in the history
…ways
  • Loading branch information
Sutherland, Landon Dexter committed Aug 19, 2020
1 parent 3d7a5d9 commit bdf9c43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ class QuixxScoreCard extends Component {
disabled[disabled.length - 1] = false;
}
} else {
disabled = disabled.map((element, i) => i < marks.lastIndexOf(true) ? true : false);
const numMarks = marks.filter(value => value).length;
disabled = disabled.map((element, i) => {
// Check lock section first, then check the rest
return (i >= marks.length - 2 && numMarks < 5) || i < marks.lastIndexOf(true);
});
}

this.setState({
Expand Down

0 comments on commit bdf9c43

Please sign in to comment.