From 5057294c0e07eddd4cd4e2e7f6af21a3b3e3cb45 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 9 Jan 2021 01:23:04 -0700 Subject: [PATCH] Add response listener for GameReset --- web/src/components/Hand.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/src/components/Hand.vue b/web/src/components/Hand.vue index 0143ff2..ba6b307 100644 --- a/web/src/components/Hand.vue +++ b/web/src/components/Hand.vue @@ -142,6 +142,18 @@ export default { 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`); + }, }, }