mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
fix, open file
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user