offline messagens

This commit is contained in:
Peter Maquiran
2022-02-04 00:22:35 +01:00
parent 61de7b937b
commit 0f04ad98c2
11 changed files with 381 additions and 239 deletions
+22 -5
View File
@@ -23,6 +23,7 @@ export class MessageService {
file
attachments
offline = true
displayType = ''
constructor(private storage: Storage) {
}
@@ -49,14 +50,16 @@ export class MessageService {
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
});
this.getFileFromDb()
if(this.file.type) {
if(this.file.type != 'application/webtrix' && typeof(this.file.type) == 'string') {
this.displayType = this.file.type.replace('application/','').toUpperCase()
}
}
}
}
delete() {}
@@ -75,4 +78,18 @@ export class MessageService {
return firstName + ' ' + lastName
}
getFileFromDb() {
if (this.file) {
if (this.file.guid) {
this.storage.get(this.file.guid).then((image) => {
if(image != null) {
this.file.image_url = image
}
});
}
}
}
}