Avoid empty command
This commit is contained in:
parent
d1ebe7fe48
commit
e375be853a
1 changed files with 4 additions and 1 deletions
|
@ -241,8 +241,11 @@ socket.on("glitched command", data => {
|
|||
|
||||
document.querySelector(".validation").addEventListener("click", ev => {
|
||||
ev.stopPropagation();
|
||||
if (!current.plate && !current.ingredient.length && !current.sauce.length && !current.drink && !current.dessert) {
|
||||
alert("Empty command !");
|
||||
return;
|
||||
}
|
||||
current["client"] = 1;
|
||||
|
||||
socket.emit("add command", current);
|
||||
current = {"plate": null, "ingredient": [], "sauce": [], "drink": null, "dessert": null};
|
||||
document.querySelectorAll("input[name=plate],input[name=drink],input[name=dessert]").forEach( e => {
|
||||
|
|
Reference in a new issue