mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
fix
This commit is contained in:
@@ -638,18 +638,15 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//"title": this.capturedImageTitle ,
|
||||
//"text": "description",
|
||||
"title_link_download": false,
|
||||
//"image_url": this.capturedImage,
|
||||
"type": "application/img",
|
||||
"guid": '',
|
||||
"image_url": imageData
|
||||
}]
|
||||
})
|
||||
|
||||
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
|
||||
updateMessage({
|
||||
file: {
|
||||
type: "application/img",
|
||||
guid: guid.path,
|
||||
image_url: imageData
|
||||
}
|
||||
})
|
||||
message.file.guid = guid.path
|
||||
|
||||
|
||||
this.AttachmentsService.downloadFile(guid.path).subscribe(async (event) => {
|
||||
|
||||
@@ -659,6 +656,23 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} else if (event.type === HttpEventType.Response) {
|
||||
var fileImage = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||
console.log('add picture to chat',fileImage);
|
||||
|
||||
updateMessage({
|
||||
file: {
|
||||
type: "application/img",
|
||||
guid: guid.path,
|
||||
image_url: fileImage
|
||||
},
|
||||
attachments: [{
|
||||
//"title": this.capturedImageTitle ,
|
||||
//"text": "description",
|
||||
"title_link_download": false,
|
||||
"type": "application/img",
|
||||
guid: guid.path,
|
||||
"image_url": fileImage
|
||||
}]
|
||||
})
|
||||
|
||||
await this.storage.set(guid.path, fileImage).then(() => {
|
||||
console.log('add picture to chat IMAGE SAVED')
|
||||
message.getFileFromDb()
|
||||
|
||||
@@ -658,10 +658,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"image_url": imageData
|
||||
},
|
||||
attachments: [{
|
||||
//"title": this.capturedImageTitle ,
|
||||
//"text": "description",
|
||||
"title": file.name,
|
||||
"title_link_download": false,
|
||||
//"image_url": this.capturedImage,
|
||||
"image_url": imageData,
|
||||
}]
|
||||
})
|
||||
|
||||
@@ -744,10 +743,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"image_url": fileImage
|
||||
},
|
||||
attachments: [{
|
||||
//"title": this.capturedImageTitle ,
|
||||
//"text": "description",
|
||||
"title": capturedImageTitle ,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
//"image_url": this.capturedImage,
|
||||
"image_url": capturedImage,
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user