Skip to content

Commit

Permalink
Do cheap check first
Browse files Browse the repository at this point in the history
  • Loading branch information
moorscode committed Feb 13, 2021
1 parent 6a5f85b commit 5bbb825
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/src/pokers/poker-room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class PokerRoom {
* @returns {void}
*/
private changeVote( memberId: string, vote: VoteValue ): void {
if ( ! this.hasEverybodyVoted( this.currentStory ) ) {
if ( ! this.hasAllVotes( this.currentStory ) ) {
this.getCurrentVote( memberId ).initialValue = vote;
}
if ( this.getCurrentVote( memberId ).initialValue === "coffee" ) {
Expand Down Expand Up @@ -339,9 +339,10 @@ export class PokerRoom {
* @returns {Vote[]} List of votes.
*/
public getCurrentVotes(): Vote[] {
if ( this.hasEverybodyVoted( this.currentStory ) || this.currentStory.votesRevealed ) {
if ( this.currentStory.votesRevealed || this.hasAllVotes( this.currentStory ) ) {
return this.getUnobscuredVotes( this.currentStory );
}

return this.getObscuredVotes( this.currentStory );
}

Expand Down

0 comments on commit 5bbb825

Please # to comment.