dumb mistake
This commit is contained in:
@@ -63,7 +63,7 @@ function initializeSocket(server) {
|
||||
if (result.rows.length > 0) {
|
||||
const newMessage = result.rows[0];
|
||||
const formattedMessage = `Username: ${newMessage.username}, recipient: ${newMessage.recipient}, message: ${newMessage.content}`;
|
||||
console.log(formattedMessage);
|
||||
//console.log(formattedMessage);
|
||||
|
||||
// Emit message to the sender's and recipient's rooms
|
||||
io.to(username).to(recipient).emit('chat message', { username: newMessage.username, recipient: newMessage.recipient, content: newMessage.content });
|
||||
@@ -103,7 +103,7 @@ function initializeSocket(server) {
|
||||
|
||||
if (result.rows.length > 0) {
|
||||
//const { username: sender, recipient: receiver, content: content, id: id } = result.rows;
|
||||
console.log('Sending historical messages:', result.rows);
|
||||
console.log('Sending historical messages');
|
||||
socket.emit('messages history', result.rows);
|
||||
} else {
|
||||
io.emit('no messages', );
|
||||
|
||||
Reference in New Issue
Block a user