Skip to content

Commit

Permalink
Hotfix coin toss count logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tlsgmltjd committed May 7, 2024
1 parent 4fcc731 commit f676b09
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public Integer coinTossCount() {
UserEntity currentUser = userFacade.getCurrentUser();
Optional<GameEntity> game = gameJpaRepository.findByUser(currentUser);

return game.isPresent() ? game.get().getCoinToss() : 10;
return game.map(gameEntity -> (10 - gameEntity.getCoinToss())).orElse(10);
}
}

0 comments on commit f676b09

Please sign in to comment.