patch reducer compile warnings

This commit is contained in:
sorrelbri 2020-02-07 18:03:28 -08:00
parent 401076cd50
commit 3e2a956634

View file

@ -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,21 +18,17 @@ 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) {