fix donwload attachment and modal to edit message

This commit is contained in:
Peter Maquiran
2024-08-29 12:13:15 +01:00
parent 97ad62e2b6
commit d8d294b662
38 changed files with 627 additions and 198 deletions
@@ -173,7 +173,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.listenToIncomingMessage();
this.listenToDeleteMessage();
this.listenToUpdateMessage();
this.listenToSendMessage()
this.listenToSendMessage();
// this.roomMessage$ = this.messageRepositoryService.getItemsLive(this.roomId)
@@ -211,14 +211,19 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async loadAttachment() {
for(const message of this.messages1[this.roomId]) {
if(message.hasAttachment) {
console.log('get attachment')
const result = await this.chatServiceService.getMessageAttachmentByMessageId(message)
console.log('result')
if(result.isOk()) {
console.log(result.value, message)
message.attachments[0].safeFile = result.value
} else {
console.log('error', result.error)
}
}
@@ -562,6 +567,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const message = new MessageEntity();
message.roomId = this.roomId
message.sentAt = new Date().toISOString()
message.sender = {
userPhoto: '',