From a0a7bd4c10f9547de86c2b177bba6241c96b6e89 Mon Sep 17 00:00:00 2001 From: flifloo Date: Sat, 30 May 2020 19:01:33 +0200 Subject: [PATCH] Fix user creation for service --- public/javascripts/service.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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", () => {