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('engine/setJson', data)
|
||||||
store.commit('game/setStateAndPhase', data.game)
|
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 = {
|
export const mutations = {
|
||||||
setStateAndPhase(state, { state: gameState, phase }) {
|
setStateAndPhase(state, game) {
|
||||||
|
if (game) {
|
||||||
|
const { state: gameState, phase } = game
|
||||||
state.state = gameState
|
state.state = gameState
|
||||||
state.phase = phase
|
state.phase = phase
|
||||||
|
} else{
|
||||||
|
state.state = ""
|
||||||
|
state.phase = ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,13 @@ export const state = () => ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
setRound(state, { quote, sources }) {
|
setRound(state, game) {
|
||||||
state.quote = quote
|
if (game && game.round) {
|
||||||
state.sources = sources
|
state.quote = game.round.quote
|
||||||
|
state.sources = game.round.sources
|
||||||
|
} else {
|
||||||
|
state.quote = ""
|
||||||
|
state.sources = []
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user