Guest User

Untitled

a guest
Mar 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. const players = queryString.parse(this.props.location.search);
  2. api.battle([
  3. players.playerOneName,
  4. players.playerTwoName
  5. ]).then((players) => {
  6. if(players === null) {
  7. return this.setState(() => {
  8. return {
  9. error: 'Looks like there was an error. Check that both users exist',
  10. loading: false
  11. }
  12. });
  13. }
  14. this.setState(() => {
  15. return {
  16. error: null,
  17. winner: players[0],
  18. loser: players[1],
  19. loading: false
  20. }
  21. });
  22. }.bind(this)); // <-- This causes an error in both my editor and webpack
Add Comment
Please, Sign In to add comment