diff --git a/src/views/Lobby.vue b/src/views/Lobby.vue index 2181dba..fa7ef61 100644 --- a/src/views/Lobby.vue +++ b/src/views/Lobby.vue @@ -21,6 +21,15 @@ export default { data() {return { players: [] }}, + mounted() { + this.game_code = sessionStorage.getItem(`game-code`); + this.is_host = JSON.parse(sessionStorage.getItem(`is-host`)); + + // Get the player data if the host loaded the component + if (this.is_host) { + this.$nextTick(() => this.getPlayerList()); + }; + }, methods: { getPlayerList() { this.$socket.emit(`GetPlayerList`, {