Skip to content

Commit

Permalink
adjusts object key for round users 🔨
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickoo committed Apr 8, 2016
1 parent 106ddb0 commit 152dbc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/reducers/round.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 3,7 @@ import { VOTED } from '../../actions/user'
const points = [1, 2, 3, 5, 8, 13, 20, 40, 100]
const defaultState = {
ticket: {},
roundUsers: [],
users: [],
userVotes: [],
points: points,
recommended: [],
Expand All @@ -17,7 17,7 @@ export default function round (state = defaultState, action) {
const { id, title, url } = action
const ticket = { id, title, url }

return { ...state, ticket, roundUsers: [], userVotes: [], active: true, recommended: [], estimation: 0 }
return { ...state, ticket, users: [], userVotes: [], active: true, recommended: [], estimation: 0 }
}

if (action.type === VOTE) {
Expand Down
4 changes: 2 additions & 2 deletions server/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 43,15 @@ export default class Room {
}

startVoteRound () {
this.round = { votes: {}, finished: false, roundUsers: this.users }
this.round = { votes: {}, finished: false, users: this.users }
}

setRoundVote (user, value) {
this.round.votes[user] = value
}

roundFinished () {
const users = this.round.roundUsers.filter((u) => !u.pm)
const users = this.round.users.filter((u) => !u.pm)
const finished = Object.keys(this.round.votes).length === users.length

if (finished) {
Expand Down

0 comments on commit 152dbc0

Please sign in to comment.