stub default falsey values for initState function to prevent crash on 500

This commit is contained in:
Sorrel Bri 2020-01-29 13:00:00 -08:00 committed by sorrelbri
parent ffda6a8164
commit 7bca0e9a04

View file

@ -5,13 +5,22 @@ const socket = require('../../io');
export const initState = (): state => {
return {
user: {},
user: { username: '', email: '', id: 0 },
errors: {},
currentRoom: {},
messages: {},
games: {},
currentRoom: { description: '', id: 0, language: '', name: '' },
messages: [ {
admin: false, content: '', username: ''
} ],
games: [ {
boardSize: 0, handicap: 0, id: 0, komi: 0.0, open: false,
playerBlack: '', playerBlackRank: '', playerWhite: '',
playerWhiteRank: '', winType: null
} ],
joinGame: {},
socket: {},
connect: {}
socket: {
connected: false,
nsp: ''
},
connect: { location: '', type: '' }
};
}