Skip to content

Commit 8d4dad6

Browse files
committed
Fixed issue where smartcard can add players twice
1 parent d1b934e commit 8d4dad6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

routes/matches.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ router.get('/:id/result', function (req, res, next) {
241241

242242
/* Method for starting a new match */
243243
router.post('/new', function (req, res, next) {
244-
const players = req.body.players;
244+
const players = [...new Set(req.body.players)];
245245
if (players === undefined || players.length === 0) {
246246
debug('No players specified, unable to start leg');
247247
res.status(400).send("No players specified").end();

src/pages/index/components/new-game-form/new-game-form.component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module.exports = {
9292
const player = _.find(this.input.players, (p) => {
9393
return p.id === playerId;
9494
});
95-
if (player) {
95+
if (player && this.state.selected.indexOf(player) === -1) {
9696
this.addPlayer(null, player);
9797
}
9898
});

0 commit comments

Comments
 (0)