patch reducer compile warnings
This commit is contained in:
parent
401076cd50
commit
3e2a956634
1 changed files with 5 additions and 10 deletions
|
@ -3,12 +3,11 @@ import { stateReducer } from '../reducer';
|
||||||
export const gamesReducer = (state, action) => {
|
export const gamesReducer = (state, action) => {
|
||||||
switch(action.message) {
|
switch(action.message) {
|
||||||
|
|
||||||
case 'SET_GAMES': {
|
case 'SET_GAMES':
|
||||||
const games = formatGames(action);;
|
const games = formatGames(action);;
|
||||||
return {...state, games};
|
return {...state, games};
|
||||||
}
|
|
||||||
|
|
||||||
case 'JOIN_REQUEST': {
|
case 'JOIN_REQUEST':
|
||||||
if (!Object.entries(state.user).length) {
|
if (!Object.entries(state.user).length) {
|
||||||
const errAction = {
|
const errAction = {
|
||||||
type: 'ERR',
|
type: 'ERR',
|
||||||
|
@ -19,22 +18,18 @@ export const gamesReducer = (state, action) => {
|
||||||
}
|
}
|
||||||
const id = action.body;
|
const id = action.body;
|
||||||
return {...state, joinGame: id};
|
return {...state, joinGame: id};
|
||||||
}
|
|
||||||
|
|
||||||
case 'UPDATE_BOARD': {
|
case 'UPDATE_BOARD':
|
||||||
console.log(action.body)
|
console.log(action.body)
|
||||||
return {...state, board: action.body};
|
return {...state, board: action.body};
|
||||||
}
|
|
||||||
|
|
||||||
case 'SET_ACTIVE': {
|
case 'SET_ACTIVE':
|
||||||
return {...state, active: action.body};
|
return {...state, active: action.body};
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function parseRank(rank) {
|
function parseRank(rank) {
|
||||||
switch(rank[0]) {
|
switch(rank[0]) {
|
||||||
|
|
Loading…
Reference in a new issue