Bug msg repeated

This commit is contained in:
Eudes Inácio
2022-01-28 15:28:21 +01:00
parent 33eddc7b73
commit f31d5fb0ff
4 changed files with 61 additions and 34 deletions
+13 -1
View File
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import { Message } from 'src/app/models/chatMethod';
import { chatHistory, ChatMessage, File } from 'src/app/models/chatMethod'
import { Storage } from '@ionic/storage';
@Injectable({
providedIn: 'root'
@@ -20,7 +21,8 @@ export class MessageService {
file
attachments
constructor() { }
constructor(private storage: Storage) {
}
setData({customFields, channels, mentions, msg ,rid ,ts, u, t, _id, _updatedAt, file, attachments}:Message) {
this.customFields = customFields
@@ -35,6 +37,16 @@ export class MessageService {
this._updatedAt = _updatedAt
this.file = file
this.attachments = attachments
if (this.file) {
if (this.file.guid) {
this.storage.get(this.file.guid).then((image) => {
console.log('IMAGE FROM STORAGE', image)
this.file.image_url = image
});
}
}
}
delete() {}