fixed engine
This commit is contained in:
parent
2dd280ce25
commit
85d7ea9086
@ -3,5 +3,5 @@ export default function(data) {
|
||||
|
||||
store.commit('engine/setJson', data)
|
||||
store.commit('game/setStateAndPhase', data.game)
|
||||
store.commit('round/setRound', data.game.round)
|
||||
store.commit('round/setRound', data.game)
|
||||
}
|
||||
|
@ -4,8 +4,14 @@ export const state = () => ({
|
||||
})
|
||||
|
||||
export const mutations = {
|
||||
setStateAndPhase(state, { state: gameState, phase }) {
|
||||
setStateAndPhase(state, game) {
|
||||
if (game) {
|
||||
const { state: gameState, phase } = game
|
||||
state.state = gameState
|
||||
state.phase = phase
|
||||
} else{
|
||||
state.state = ""
|
||||
state.phase = ""
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -4,8 +4,13 @@ export const state = () => ({
|
||||
})
|
||||
|
||||
export const mutations = {
|
||||
setRound(state, { quote, sources }) {
|
||||
state.quote = quote
|
||||
state.sources = sources
|
||||
setRound(state, game) {
|
||||
if (game && game.round) {
|
||||
state.quote = game.round.quote
|
||||
state.sources = game.round.sources
|
||||
} else {
|
||||
state.quote = ""
|
||||
state.sources = []
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user