Skip to content

Commit

Permalink
Fixed issue where smartcard can add players twice
Browse files Browse the repository at this point in the history
  • Loading branch information
thordy committed Dec 11, 2024
1 parent d1b934e commit 8d4dad6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion routes/matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ router.get('/:id/result', function (req, res, next) {

/* Method for starting a new match */
router.post('/new', function (req, res, next) {
const players = req.body.players;
const players = [...new Set(req.body.players)];
if (players === undefined || players.length === 0) {
debug('No players specified, unable to start leg');
res.status(400).send("No players specified").end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = {
const player = _.find(this.input.players, (p) => {
return p.id === playerId;
});
if (player) {
if (player && this.state.selected.indexOf(player) === -1) {
this.addPlayer(null, player);
}
});
Expand Down

0 comments on commit 8d4dad6

Please sign in to comment.