quit game and clear interval

This commit is contained in:
ntr
2018-10-24 16:19:27 +11:00
parent 5886f9413b
commit 8be14ac546
3 changed files with 19 additions and 3 deletions
+8 -2
View File
@@ -11,8 +11,14 @@ const GameContainer = require('./game.container');
const addState = connect(
function receiveState(state) {
const {game} = state;
return {game};
const { game, ws } = state;
if (!game) {
console.log('out of game');
ws.clearGameStateInterval();
}
return { game };
},
function receiveDispatch(dispatch) {
function setGame(game) {