0
0
Fork 0

Implement UpdateAnswer functionality on the client

This commit is contained in:
Oliver-Akins 2021-01-03 00:06:29 -07:00
parent f602f78604
commit 3abec8ccda

View file

@ -126,13 +126,13 @@ export default {
*/
let team = this.$store.state.team;
let data = {
game_code: this.$store.state.game_code,
team: team,
answer: answerIndex,
value: this.answers[`team_${team}`][answerIndex - 1]
};
// TODO -> Send data to socket.io server
console.log(data)
this.$socket.client.emit(`UpdateAnswer`, data);
},
},
sockets: {
@ -147,8 +147,8 @@ export default {
* value: string
* }
*/
this.answers[`team_${data.team}`][data.answer - 1] = data.value;
}
this.answers[`team_${data.team}`].splice(data.answer - 1, 1, data.value);
},
},
}
</script>