0
0
Fork 0

Add players array and related mutations

This commit is contained in:
Oliver-Akins 2021-01-01 16:09:40 -07:00
parent dd365dde86
commit f31341ffd8
2 changed files with 33 additions and 9 deletions

View file

@ -64,7 +64,10 @@ export default {
return;
};
history.replaceState(null, ``, `?game=${data.game_code}`);
// Save the data in the store
this.$store.commit(`playerList`, data.players);
this.$store.commit(`game_code`, this.game_code);
this.$store.commit(`player`, {
name: this.name,
@ -79,7 +82,10 @@ export default {
return;
};
history.replaceState(null, ``, `?game=${data.game_code}`);
// Update storage
this.$store.commit(`playerList`, data.players);
this.$store.commit(`game_code`, data.game_code);
this.$store.commit(`player`, {
name: this.name,