feat: display specific truncated content for image and file messages in conversations.
This commit is contained in:
@@ -240,8 +240,15 @@ export class MessagesService {
|
||||
});
|
||||
|
||||
// Update conversation with last message info and unread counts
|
||||
const truncatedContent =
|
||||
dto.content.length > 255 ? dto.content.substring(0, 252) + '...' : dto.content;
|
||||
let truncatedContent: string;
|
||||
if (dto.messageType === 'IMAGE') {
|
||||
truncatedContent = 'Sent an image';
|
||||
} else if (dto.messageType === 'FILE') {
|
||||
truncatedContent = 'Sent a file';
|
||||
} else {
|
||||
truncatedContent =
|
||||
dto.content.length > 255 ? dto.content.substring(0, 252) + '...' : dto.content;
|
||||
}
|
||||
|
||||
await this.prisma.conversation.update({
|
||||
where: { id: conversationId },
|
||||
|
||||
Reference in New Issue
Block a user