0
0
Fork 0

Add response listener for GameReset

This commit is contained in:
Oliver-Akins 2021-01-09 01:23:04 -07:00
parent c16257cdbe
commit 5057294c0e

View file

@ -142,6 +142,18 @@ export default {
console.error(`Server returned an unsupported mode: ${data.mode}`); console.error(`Server returned an unsupported mode: ${data.mode}`);
}; };
}, },
GameReset(data) {
if (data.status < 200 || 300 <= data.status) {
return this.$emit(`error`, data);
};
this.$store.commit(`setAnswers`, {
team_1: new Array(8).fill(``),
team_2: new Array(8).fill(``),
});
this.$store.commit(`replaceHand`, []);
this.$store.commit(`setObject`, null);
this.$store.commit(`view`, `lobby`);
},
}, },
} }
</script> </script>