Empty usernames or room-names are not allowed

This commit is contained in:
H4CK3R-01 2021-07-11 16:01:33 +02:00 committed by H4CK3R-01
parent 7010fb32c9
commit 5fcae6f2e1

View File

@ -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() {