stub default falsey values for initState function to prevent crash on 500
This commit is contained in:
parent
025aee43c8
commit
ba8a89ee6a
1 changed files with 15 additions and 6 deletions
|
@ -5,13 +5,22 @@ const socket = require('../../io');
|
||||||
|
|
||||||
export const initState = (): state => {
|
export const initState = (): state => {
|
||||||
return {
|
return {
|
||||||
user: {},
|
user: { username: '', email: '', id: 0 },
|
||||||
errors: {},
|
errors: {},
|
||||||
currentRoom: {},
|
currentRoom: { description: '', id: 0, language: '', name: '' },
|
||||||
messages: {},
|
messages: [ {
|
||||||
games: {},
|
admin: false, content: '', username: ''
|
||||||
|
} ],
|
||||||
|
games: [ {
|
||||||
|
boardSize: 0, handicap: 0, id: 0, komi: 0.0, open: false,
|
||||||
|
playerBlack: '', playerBlackRank: '', playerWhite: '',
|
||||||
|
playerWhiteRank: '', winType: null
|
||||||
|
} ],
|
||||||
joinGame: {},
|
joinGame: {},
|
||||||
socket: {},
|
socket: {
|
||||||
connect: {}
|
connected: false,
|
||||||
|
nsp: ''
|
||||||
|
},
|
||||||
|
connect: { location: '', type: '' }
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Reference in a new issue