From 19618cb218df15c7187e591dbda538d8a2a58727 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Mon, 28 Sep 2020 23:03:56 -0600 Subject: [PATCH] Add code to handle getting a player list from the server --- src/views/Lobby.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/views/Lobby.vue b/src/views/Lobby.vue index 23e92ed..3b76973 100644 --- a/src/views/Lobby.vue +++ b/src/views/Lobby.vue @@ -39,9 +39,14 @@ export default { }, sockets: { PlayerListResponse(data) { - if (data.success) {} else { - this.$emit(`alert`) - } + if (data.success) { + this.players = data.players; + } else { + this.$emit(`alert`, { + message: data.message, + classes: [`warning`], + }); + }; }, PlayerJoin() {}, },