Empty usernames or room-names are not allowed
This commit is contained in:
parent
7010fb32c9
commit
5fcae6f2e1
@ -10,6 +10,7 @@ document.getElementById('ok').addEventListener('click', function () {
|
||||
username = document.getElementById('username').value;
|
||||
room_name = document.getElementById('room').value;
|
||||
|
||||
if (username !== "" && room_name !== "") {
|
||||
socket = io("/", {
|
||||
closeOnBeforeunload: false
|
||||
});
|
||||
@ -51,6 +52,9 @@ document.getElementById('ok').addEventListener('click', function () {
|
||||
socket.on('user left', function (data) {
|
||||
addLogMessage(data + ' left');
|
||||
});
|
||||
} else {
|
||||
document.getElementById('error').innerText = 'Username and/or room name cannot be empty!';
|
||||
}
|
||||
});
|
||||
|
||||
function open_manual() {
|
||||
|
Loading…
Reference in New Issue
Block a user