diff options
author | jbion <joffrey.bion@amadeus.com> | 2017-05-19 20:17:35 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-20 00:12:39 +0200 |
commit | a13f913c6a594a14a2cb9ab42dbd0493372583fb (patch) | |
tree | 2ac200b06532b7be09b0192a4455ab132cd5010b /frontend/src/sagas/gameBrowser.js | |
parent | Set versions of packages to latest (diff) | |
download | seven-wonders-a13f913c6a594a14a2cb9ab42dbd0493372583fb.tar.gz seven-wonders-a13f913c6a594a14a2cb9ab42dbd0493372583fb.tar.bz2 seven-wonders-a13f913c6a594a14a2cb9ab42dbd0493372583fb.zip |
Add error toasts
Diffstat (limited to 'frontend/src/sagas/gameBrowser.js')
-rw-r--r-- | frontend/src/sagas/gameBrowser.js | 16 |
1 files changed, 9 insertions, 7 deletions
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) { |