fix, open file

This commit is contained in:
Peter Maquiran
2024-09-12 14:50:10 +01:00
parent 4413ce4698
commit e2df6a0919
10 changed files with 154 additions and 71 deletions
+7 -1
View File
@@ -1,4 +1,5 @@
import { IRoom, RoomEntitySchema } from "src/app/core/chat/entity/group";
import { MessageAttachmentSource } from "src/app/core/chat/entity/message";
import { isDocument } from "src/app/utils/document-mimetype";
export class RoomViewModel implements IRoom {
@@ -19,12 +20,17 @@ export class RoomViewModel implements IRoom {
Object.assign(this, model)
this.formatarData()
this.check()
}
check() {
if(this.messages?.[0]?.attachments[0]?.mimeType?.startsWith('image/') ) {
this.lastMessageImage = true
} else if (this.messages?.[0]?.attachments[0]?.mimeType && isDocument({mimeType: this.messages?.[0]?.attachments[0]?.mimeType})) {
this.lastMessageDocument = true
} else if (this.messages?.[0]?.attachments[0]?.source == MessageAttachmentSource.Webtrix) {
this.lastMessageDocument = true
}
}
formatarData() {