Merge pull request #62 from H4CK3R-01/fix_error

Show error message if room is full
This commit is contained in:
Florian Kaiser 2021-07-12 10:28:43 +02:00 committed by GitHub
commit c0a59db2dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,13 +47,10 @@ document.getElementById('ok').addEventListener('click', function () {
}); });
socket.on('error', function (data) { socket.on('error', function (data) {
if (data === 'Game started already or room has two many members') { document.getElementById('login').style.display = 'flex';
document.getElementById('login').style.display = 'flex'; document.getElementById('game').style.display = 'none';
document.getElementById('game').style.display = 'none'; document.getElementById('chat').style.display = 'none';
document.getElementById('chat').style.display = 'none'; document.getElementById('error').innerText = data;
document.getElementById('error').innerText = data;
}
console.log(data);
}); });
socket.on('new message', function (data) { socket.on('new message', function (data) {