From a13f913c6a594a14a2cb9ab42dbd0493372583fb Mon Sep 17 00:00:00 2001 From: jbion Date: Fri, 19 May 2017 20:17:35 +0200 Subject: Add error toasts --- frontend/src/sagas/gameBrowser.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'frontend/src/sagas/gameBrowser.js') diff --git a/frontend/src/sagas/gameBrowser.js b/frontend/src/sagas/gameBrowser.js index 10d6ec1d..b12587ef 100644 --- a/frontend/src/sagas/gameBrowser.js +++ b/frontend/src/sagas/gameBrowser.js @@ -3,7 +3,7 @@ import { createSubscriptionChannel } from '../utils/websocket' import { push } from 'react-router-redux' import { normalize } from 'normalizr' -import { game as gameSchema, gameList as gameListSchema} from '../schemas/games' +import { game as gameSchema, gameList as gameListSchema } from '../schemas/games' import { actions as gameActions, types } from '../redux/games' import { actions as playerActions } from '../redux/players' @@ -39,15 +39,17 @@ function *watchLobbyJoined({socket}) { } function *createGame({socket}) { - const {gameName} = yield take(types.REQUEST_CREATE_GAME) - - yield apply(socket, socket.send, ['/app/lobby/create', JSON.stringify({gameName}), {}]) + while (true) { + const {gameName} = yield take(types.REQUEST_CREATE_GAME) + yield apply(socket, socket.send, ['/app/lobby/create', JSON.stringify({gameName}), {}]) + } } function *joinGame({socket}) { - const {gameId} = yield take(types.REQUEST_JOIN_GAME) - - yield apply(socket, socket.send, ['/app/lobby/join', JSON.stringify({gameId}), {}]) + while (true) { + const {gameId} = yield take(types.REQUEST_JOIN_GAME) + yield apply(socket, socket.send, ['/app/lobby/join', JSON.stringify({gameId}), {}]) + } } function *gameBrowserSaga(socketConnection) { -- cgit