Fix voting

This commit is contained in:
Chris Blanchard 2016-03-19 13:59:48 +00:00
parent 1363826137
commit ad55f5fe6d
3 changed files with 10 additions and 6 deletions

View file

@ -9,6 +9,7 @@ const hiveUrl = helper.hiveUrl;
const SelectPlayerButton = React.createClass({
propTypes: {
socket: React.PropTypes.object.isRequired,
gather: React.PropTypes.object.isRequired,
gatherer: React.PropTypes.object.isRequired
},
@ -368,13 +369,13 @@ const GatherActions = React.createClass({
<div>
<div className="text-right">
<ul className="list-inline no-bottom">
<li>
{regatherButton}
</li>
<li>
<JoinGatherButton gather={gather} thisGatherer={thisGatherer}
user={user} socket={socket} />
</li>
<li>
{regatherButton}
</li>
</ul>
</div>
</div>
@ -836,7 +837,9 @@ const GathererListItem = React.createClass({
thisGatherer.team === gather.pickingTurn) {
action = (
<span>
<SelectPlayerButton gatherer={gatherer} socket={socket}/>
<SelectPlayerButton gatherer={gatherer}
gather={gather}
socket={socket}/>
</span>
);
} else {

View file

@ -362,6 +362,7 @@ const GatherPage = React.createClass({
onGatherSelected(gatherName) {
let gather = this.state.gatherPool[gatherName];
if (gather === undefined) return;
this.updateTitle();
this.setState({
currentGather: gather.type
});

View file

@ -171,7 +171,7 @@ module.exports = function (namespace) {
let playerId = data.player;
// Check team & leader
let gatherer = gatherPool.getGatherer(socket._user);
let gatherer = gather.getGatherer(socket._user);
// Cancel if not gatherer or leader
if (gatherer === null || gatherer.leader === false) {
@ -179,7 +179,7 @@ module.exports = function (namespace) {
}
// Cancel if id belongs to a leader
let selectedPlayer = gatherPool.getGatherer({id: playerId});
let selectedPlayer = gather.getGatherer({id: playerId});
if (selectedPlayer === null || selectedPlayer.leader) {
return null;