diff --git a/src/views/JoinHost.vue b/src/views/JoinHost.vue index 4c50262..8173978 100644 --- a/src/views/JoinHost.vue +++ b/src/views/JoinHost.vue @@ -19,18 +19,6 @@ export default { name: 'JoinHost', components: {}, data() {return {}}, - sockets: { - HostInformation(data) { - console.log(data) - if (data.success) { - sessionStorage.setItem(`game-code`, data.game_code); - this.$emit(`is-host`, true); - this.$emit(`go-to`, `lobby`); - } else { - this.error = data.error_message - }; - } - }, methods: { host_game() { let username = ``; @@ -46,9 +34,21 @@ export default { }); }, join_game() { - this.$emit(`go-to`, ``) + this.$emit(`go-to`, `game-code`) }, }, + sockets: { + HostInformation(data) { + if (data.success) { + sessionStorage.setItem(`game-code`, data.game_code); + this.$emit(`is-host`, true); + // this.$emit(`go-to`, `lobby`); + this.$store.state.state = `lobby`; + } else { + this.error = data.error_message + }; + } + }, }