summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-18 15:40:40 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-18 15:40:50 +0100
commitda5bc280b65c05d76a65083fd7b8dfd330e7acd3 (patch)
tree5bd251fabfb43b4cf03a338624b8619ee4857e7a /public
parent74387b19435724b8eac85960dcd64b55315bdc63 (diff)
downloadserver-da5bc280b65c05d76a65083fd7b8dfd330e7acd3.tar.gz
Don't try to Invite with empty field.
Diffstat (limited to 'public')
-rw-r--r--public/join.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/public/join.js b/public/join.js
index cc8d325..185aa6c 100644
--- a/public/join.js
+++ b/public/join.js
@@ -46,8 +46,10 @@ function accept(role) {
function send_invite() {
let invite_user = document.getElementById("invite_user").value
- post(`/invite/${game.game_id}/${encodeURIComponent(invite_role)}/${encodeURIComponent(invite_user)}`)
- document.getElementById("invite").close()
+ if (invite_user) {
+ post(`/invite/${game.game_id}/${encodeURIComponent(invite_role)}/${encodeURIComponent(invite_user)}`)
+ document.getElementById("invite").close()
+ }
}
function show_invite(role) {