summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-08-07 23:56:23 +0200
committerVictor Chabbert <chabbertvi@eisti.eu>2017-08-07 23:56:23 +0200
commit6b9ebbfbd6fbe47900a4f2e785c550edb915669a (patch)
treebfff955ecd3fe675c679b905359326792a526ab3 /frontend/src
parentRemove unnecessary selector (diff)
downloadseven-wonders-6b9ebbfbd6fbe47900a4f2e785c550edb915669a.tar.gz
seven-wonders-6b9ebbfbd6fbe47900a4f2e785c550edb915669a.tar.bz2
seven-wonders-6b9ebbfbd6fbe47900a4f2e785c550edb915669a.zip
Fix flow errors
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/sagas/errors.js2
-rw-r--r--frontend/src/sagas/gameBrowser.js8
-rw-r--r--frontend/src/sagas/home.js5
-rw-r--r--frontend/src/sagas/lobby.js4
-rw-r--r--frontend/src/scenes/SplashScreen/index.js1
5 files changed, 11 insertions, 9 deletions
diff --git a/frontend/src/sagas/errors.js b/frontend/src/sagas/errors.js
index c5d68e62..b6ccb91d 100644
--- a/frontend/src/sagas/errors.js
+++ b/frontend/src/sagas/errors.js
@@ -7,7 +7,7 @@ import type { ApiError } from '../api/model';
import type { SevenWondersSession } from '../api/sevenWondersApi';
export default function* errorHandlingSaga(session: SevenWondersSession): * {
- const errorChannel: Channel<ApiError> = yield eventChannel(session.watchErrors());
+ const errorChannel: Channel = yield eventChannel(session.watchErrors());
try {
while (true) {
const error: ApiError = yield take(errorChannel);
diff --git a/frontend/src/sagas/gameBrowser.js b/frontend/src/sagas/gameBrowser.js
index ed17a723..81b2a848 100644
--- a/frontend/src/sagas/gameBrowser.js
+++ b/frontend/src/sagas/gameBrowser.js
@@ -2,7 +2,7 @@
import { normalize } from 'normalizr';
import { push } from 'react-router-redux';
import { eventChannel } from 'redux-saga';
-import { apply, call, put, take } from 'redux-saga/effects';
+import { apply, call, put, take, all } from 'redux-saga/effects';
import type { SevenWondersSession } from '../api/sevenWondersApi';
import { actions as gameActions, types } from '../redux/games';
import { actions as playerActions } from '../redux/players';
@@ -41,6 +41,7 @@ function* watchLobbyJoined(session: SevenWondersSession): * {
function* createGame(session: SevenWondersSession): * {
while (true) {
const { gameName } = yield take(types.REQUEST_CREATE_GAME);
+ // $FlowFixMe
yield apply(session, session.createGame, [gameName]);
}
}
@@ -48,17 +49,18 @@ function* createGame(session: SevenWondersSession): * {
function* joinGame(session: SevenWondersSession): * {
while (true) {
const { gameId } = yield take(types.REQUEST_JOIN_GAME);
+ // $FlowFixMe
yield apply(session, session.joinGame, [gameId]);
}
}
function* gameBrowserSaga(session: SevenWondersSession): * {
- yield [
+ yield all([
call(watchGames, session),
call(watchLobbyJoined, session),
call(createGame, session),
call(joinGame, session),
- ];
+ ]);
}
export default gameBrowserSaga;
diff --git a/frontend/src/sagas/home.js b/frontend/src/sagas/home.js
index a6f19565..89271706 100644
--- a/frontend/src/sagas/home.js
+++ b/frontend/src/sagas/home.js
@@ -1,7 +1,7 @@
// @flow
import { push } from 'react-router-redux';
import { eventChannel } from 'redux-saga';
-import { apply, call, put, take } from 'redux-saga/effects';
+import { apply, call, put, take, all } from 'redux-saga/effects';
import type { ApiPlayer } from '../api/model';
import type { SevenWondersSession } from '../api/sevenWondersApi';
@@ -10,6 +10,7 @@ import { actions, types } from '../redux/players';
function* sendUsername(session: SevenWondersSession): * {
while (true) {
const { username } = yield take(types.REQUEST_CHOOSE_USERNAME);
+ // $FlowFixMe
yield apply(session, session.chooseName, [username]);
}
}
@@ -25,7 +26,7 @@ function* validateUsername(session: SevenWondersSession): * {
}
function* homeSaga(session: SevenWondersSession): * {
- yield [call(sendUsername, session), call(validateUsername, session)];
+ yield all([call(sendUsername, session), call(validateUsername, session)]);
}
export default homeSaga;
diff --git a/frontend/src/sagas/lobby.js b/frontend/src/sagas/lobby.js
index 754bc5bb..3f23a125 100644
--- a/frontend/src/sagas/lobby.js
+++ b/frontend/src/sagas/lobby.js
@@ -3,7 +3,7 @@ import { normalize } from 'normalizr';
import { push } from 'react-router-redux';
import type { Channel } from 'redux-saga';
import { eventChannel } from 'redux-saga';
-import { apply, call, put, take } from 'redux-saga/effects';
+import { apply, call, put, take, all } from 'redux-saga/effects';
import { SevenWondersSession } from '../api/sevenWondersApi';
import { actions as gameActions, types } from '../redux/games';
import { actions as playerActions } from '../redux/players';
@@ -49,7 +49,7 @@ function* startGame(session: SevenWondersSession): * {
}
function* lobbySaga(session: SevenWondersSession): * {
- yield [call(watchLobbyUpdates, session), call(watchGameStart, session), call(startGame, session)];
+ yield all([call(watchLobbyUpdates, session), call(watchGameStart, session), call(startGame, session)]);
}
export default lobbySaga;
diff --git a/frontend/src/scenes/SplashScreen/index.js b/frontend/src/scenes/SplashScreen/index.js
index 0732b1b3..7b45d20f 100644
--- a/frontend/src/scenes/SplashScreen/index.js
+++ b/frontend/src/scenes/SplashScreen/index.js
@@ -7,7 +7,6 @@ import HomeLayout from './components/HomeLayout';
class SplashScreen extends Component {
play = e => {
- e.preventDefault();
if (this._username !== undefined) {
this.props.chooseUsername(this._username);
}
bgstack15