added loading wheel on images, and fixed auto scroll

This commit is contained in:
slawk0
2024-12-03 22:31:31 +01:00
parent e712cef761
commit 063891d291
3 changed files with 44 additions and 18 deletions

View File

@@ -71,10 +71,10 @@ function initializeSocket(io) {
}
socket.on("chat message", async (msg, callback) => {
const { message, recipient, recipient_id, attachment_url } = msg;
const { message, recipient, recipient_id, attachment_urls } = msg;
const sender = socket.username;
if (!message && !attachment_url) {
if (!message && !attachment_urls) {
callback({
status: "error",
tempId: msg.tempId,
@@ -96,7 +96,7 @@ function initializeSocket(io) {
socket.user_id,
recipient,
message,
attachment_url,
attachment_urls,
);
if (!insertedMessage) {
callback({
@@ -120,7 +120,7 @@ function initializeSocket(io) {
io.to(username).to(recipient).to(recipient_id).emit("chat message", {
sender,
message: content,
attachment_url,
attachment_urls,
recipient,
message_id,
sender_id,
@@ -130,7 +130,7 @@ function initializeSocket(io) {
console.log("(socket) sent on 'chat message' socket: ", {
sender,
message,
attachment_url,
attachment_urls,
recipient,
timestamp,
message_id,