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.
This commit is contained in:
Jonny 2019-04-16 12:50:41 +02:00
parent e50dc7d293
commit 6890ecc7fb
1 changed files with 1 additions and 1 deletions

View File

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