From 1e972b693592c9c080c7144cb887e768b9b9811f Mon Sep 17 00:00:00 2001 From: Hamza Ali Date: Thu, 26 Sep 2019 08:11:28 +0700 Subject: [PATCH] code/static: bugfix: only send new user join message after initial userlist packet from server --- code/static/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/static/js/index.js b/code/static/js/index.js index ddf7bb0..caade35 100644 --- a/code/static/js/index.js +++ b/code/static/js/index.js @@ -56,6 +56,7 @@ function newMessage(data) { switch(data.type) { case "join": userJoin(data.content, data.date); + serverMessage(data.content + " has joined the server", data.date); break; case "leave": userLeave(data.content, data.date); @@ -116,7 +117,6 @@ function userJoin(user, date) { p.className = user; p.innerText = user; document.getElementById("users").appendChild(p); - serverMessage(user + " has joined the server", date); } function userLeave(user, date) {