knowyt/client/src/store/round.js

23 lines
483 B
JavaScript
Raw Normal View History

2021-08-15 16:52:15 +00:00
export const state = () => ({
quote: "",
sources: [],
2021-08-30 16:21:14 +00:00
selections: {},
2021-09-05 19:30:13 +00:00
revelation: {},
2021-08-15 16:52:15 +00:00
})
export const mutations = {
2021-08-15 20:04:10 +00:00
setRound(state, game) {
if (game && game.round) {
state.quote = game.round.quote
state.sources = game.round.sources
2021-08-30 16:21:14 +00:00
state.selections = game.round.selections
2021-09-05 19:30:13 +00:00
state.revelation = game.round.revelation
2021-08-15 20:04:10 +00:00
} else {
state.quote = ""
state.sources = []
2021-08-30 16:21:14 +00:00
state.selections = {}
2021-09-05 19:30:13 +00:00
state.revelation = {}
2021-08-15 20:04:10 +00:00
}
2021-08-15 16:52:15 +00:00
},
}