diff --git a/public/javascripts/service.js b/public/javascripts/service.js index d565644..625d9d7 100644 --- a/public/javascripts/service.js +++ b/public/javascripts/service.js @@ -59,9 +59,8 @@ socket.on("list user", data => { }); }); -socket.on("add user", data => { - alert("User creation fail !"); - addUser(data); +socket.on("add user", () => { + next(); }); socket.on("set service", () => { @@ -71,7 +70,8 @@ socket.on("set service", () => { socket.on("fail add user", data => { alert("User creation fail !"); - addUser(data); + if (data && data.username) + addUser(data); }); socket.on("internal error", () => {