mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -169,10 +169,10 @@ export class AuthService {
|
||||
try {
|
||||
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
|
||||
message.file.guid = guid.path
|
||||
await this.storage.set(guid.path, message.file.image_url).then(() => {
|
||||
console.log('add picture to chat IMAGE SAVED')
|
||||
message.getFileFromDb()
|
||||
});
|
||||
// await this.storage.set(guid.path, message.file.image_url).then(() => {
|
||||
// console.log('add picture to chat IMAGE SAVED')
|
||||
// // message.getFileFromDb()
|
||||
// });
|
||||
|
||||
return true
|
||||
} catch(e) {
|
||||
|
||||
@@ -102,7 +102,7 @@ export class MessageService {
|
||||
}
|
||||
|
||||
if(this.hasFile) {
|
||||
this.getFileFromDb()
|
||||
// this.getFileFromDb()
|
||||
if(this.file.type != 'application/webtrix') {
|
||||
this.displayType = this.file.type.replace('application/','').toUpperCase()
|
||||
}
|
||||
@@ -118,18 +118,18 @@ export class MessageService {
|
||||
return firstName + ' ' + lastName
|
||||
}
|
||||
|
||||
getFileFromDb() {
|
||||
// getFileFromDb() {
|
||||
|
||||
if(this.hasFile) {
|
||||
if (this.file.guid) {
|
||||
this.storage.get(this.file.guid).then((image) => {
|
||||
if(image != null) {
|
||||
this.file.image_url = image
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// if(this.hasFile) {
|
||||
// if (this.file.guid) {
|
||||
// this.storage.get(this.file.guid).then((image) => {
|
||||
// if(image != null) {
|
||||
// this.file.image_url = image
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
async send(): Promise<any> {
|
||||
|
||||
|
||||
@@ -761,13 +761,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
ts: msg.attachments[0].ts
|
||||
}
|
||||
|
||||
// save the changes to the storage
|
||||
msg.save()
|
||||
|
||||
// msg.attachments[0].image_url = 'sdfsdf'
|
||||
|
||||
await this.storage.set(msg.file.guid, this.downloadFile).then(() => {
|
||||
console.log('IMAGE SAVED')
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user