X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=empathy%2Fempathy.jsx;h=c216e4921b9b5d68d8731defddc353125a010d68;hp=20612e35336576b229c4a8f9fccc7e7bd1179e97;hb=71a123df898044213dd6703c036d6bbbea7f7f8f;hpb=7c01cc8d716fbc5fc1b21a4684e5268ef721eb1c diff --git a/empathy/empathy.jsx b/empathy/empathy.jsx index 20612e3..c216e49 100644 --- a/empathy/empathy.jsx +++ b/empathy/empathy.jsx @@ -88,6 +88,8 @@ events.addEventListener("game-state", event => { window.game.set_end_judging(state.end_judging); window.game.set_scores(state.scores); + + window.game.state_ready(); }); events.addEventListener("prompt", event => { @@ -804,7 +806,8 @@ class Game extends React.PureComponent { players_judging: {}, judging_idle: false, end_judging_votes: new Set(), - scores: null + scores: null, + ready: false }; } @@ -852,7 +855,8 @@ class Game extends React.PureComponent { players_judging: {}, judging_idle: false, end_judging_votes: new Set(), - scores: null + scores: null, + ready: false }); } @@ -982,7 +986,6 @@ class Game extends React.PureComponent { } set_judging_idle(value) { - console.log("Setting judging idle to " + value); this.setState({ judging_idle: value }); @@ -1012,6 +1015,12 @@ class Game extends React.PureComponent { }); } + state_ready() { + this.setState({ + ready: true + }); + } + render() { const state = this.state; const players_total = 1 + state.other_players.length; @@ -1072,6 +1081,9 @@ class Game extends React.PureComponent { />; } + if (! state.ready) + return null; + return [