minor changes

This commit is contained in:
slawk0
2024-11-22 19:16:16 +01:00
parent a2f77ef8b5
commit 50c62cd853
2 changed files with 4 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ export async function getMessages(
return response.data;
} catch (e) {
console.error('Failed to get messages: ', e);
//console.error('Failed to get messages: ', e);
throw e;
}
}

View File

@@ -85,7 +85,7 @@ function MessagesArea({
);
console.log('changed status to false for: ', msg.sender);
}
if (msg.sender == currentContact) {
if (msg.sender == currentContact && msg.sender !== username) {
messageHandler(msg);
}
});
@@ -126,14 +126,14 @@ function MessagesArea({
}`}
key={msg.message_id || msg.tempId}
>
{msg.sender}: {msg.message}
{msg.message_id} {msg.tempId} {msg.sender}: {msg.message}
{msg.attachment_url ? (
<div className="mt-2">
{msg.attachment_url.match(/\.(jpg|jpeg|png|gif|bmp|webp)$/i) ? (
<img
src={msg.attachment_url}
alt="attachment"
className="max-w-full max-h-40 object-contain rounded"
className="max-w-full max-h-64 object-contain rounded"
/>
) : (
<FileBox url={msg.attachment_url} />