Attempt two of fixing the webclient.
This commit is contained in:
parent
0fd8ce7788
commit
1e2a7572a6
1 changed files with 8 additions and 0 deletions
|
|
@ -32,6 +32,14 @@
|
|||
console.log('Joining chat room:', { username: username, chat_room: chatRoom });
|
||||
socket.emit('join', { username: username, chat_room: chatRoom });
|
||||
|
||||
socket.on('connect', () => {
|
||||
console.log('Connected to WebSocket server');
|
||||
});
|
||||
|
||||
socket.on('disconnect', () => {
|
||||
console.log('Disconnected from WebSocket server');
|
||||
});
|
||||
|
||||
// Listen for messages from the server
|
||||
socket.on('message', (data) => {
|
||||
const messageElement = document.createElement('div');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue