diff --git a/web/src/components/ChooseObject.vue b/web/src/components/ChooseObject.vue index cfc072b..2cb46cb 100644 --- a/web/src/components/ChooseObject.vue +++ b/web/src/components/ChooseObject.vue @@ -62,17 +62,6 @@ export default { */ this.objects = data.objects; }, - ChosenObject(data) { - /** - * Sent to all clients so that they can set their store data and in - * turn stay synchronized on what object they are trying to get - * their teammate to guess. - */ - if (data.status < 200 || 300 <= data.status) { - this.$emit(`error`, data); - }; - this.$store.commit(`setObject`, data.choice); - }, }, mounted() { this.getObjects(); diff --git a/web/src/views/InGame.vue b/web/src/views/InGame.vue index ebf7e74..6bf1eb3 100644 --- a/web/src/views/InGame.vue +++ b/web/src/views/InGame.vue @@ -48,6 +48,19 @@ export default { }, }, methods: {}, + sockets: { + ChosenObject(data) { + /** + * Sent to all clients so that they can set their store data and in + * turn stay synchronized on what object they are trying to get + * their teammate to guess. + */ + if (data.status < 200 || 300 <= data.status) { + this.$emit(`error`, data); + }; + this.$store.commit(`setObject`, data.choice); + }, + } }