From 6890ecc7fb3c2041b7f66d436950526e0bc1209d Mon Sep 17 00:00:00 2001 From: Jonny Date: Tue, 16 Apr 2019 12:50:41 +0200 Subject: [PATCH] Fix a bug with the adding of teams to groups Due to the equals one could fill up one group, decrease the max size of it and then add indefinitely many teams to the last group without a new group being created. --- js/components/EditableStringList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/EditableStringList.js b/js/components/EditableStringList.js index 06af179..c061ac6 100644 --- a/js/components/EditableStringList.js +++ b/js/components/EditableStringList.js @@ -30,7 +30,7 @@ export default class EditableStringList extends React.Component { this.state.teams.push(text); var lastGroup = this.state.groups[this.state.groups.length - 1]; - if(lastGroup === undefined || lastGroup.length === this.props.groupSize) { + if(lastGroup === undefined || lastGroup.length >= this.props.groupSize) { this.state.groups[this.state.groups.length] = []; } lastGroup = this.state.groups[this.state.groups.length - 1];