Allow server to push error message to client.
This commit is contained in:
+3
-1
@@ -311,6 +311,9 @@ function serverConnect() {
|
||||
case 'chat':
|
||||
addToChatbox(m.id, m.username, m.value, m.me);
|
||||
break;
|
||||
case 'error':
|
||||
displayError(m.message);
|
||||
break;
|
||||
default:
|
||||
console.warn('Unexpected server message', m.type);
|
||||
return;
|
||||
@@ -773,7 +776,6 @@ document.getElementById('disconnectbutton').onclick = function(e) {
|
||||
socket.close();
|
||||
}
|
||||
|
||||
|
||||
function start() {
|
||||
group = decodeURIComponent(location.pathname.replace(/^\/[a-z]*\//, ''));
|
||||
let title = document.getElementById('title');
|
||||
|
||||
Reference in New Issue
Block a user