This commit is contained in:
tiago.kayaya
2022-02-09 14:32:21 +01:00
parent ae1ddbddb2
commit e754440510
@@ -103,7 +103,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
private changeDetectorRef: ChangeDetectorRef,
private storage: Storage,
private AttachmentsService: AttachmentsService,
private CameraService: CameraService,
private toastService: ToastService,
@@ -477,7 +477,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
if (res) {
const data = res.data;
this.documents.push(data.selected);
this.addFileWebtrix()
}
});
@@ -544,7 +544,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
async takePicture() {
const roomId = this.roomId
const image = await this.CameraService.takePicture();
await this.fileService.saveImage(image)
const lastphoto: any = await this.fileService.loadFiles();
@@ -571,11 +571,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
})
}
async addImage() {
this.addFileToChat(['image/apng', 'image/jpeg', 'image/png'])
}
async addFile() {
this.addFileToChat(['.doc', '.docx', '.pdf'])
}
@@ -599,7 +599,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
if(data.selected) {
const loader = this.toastService.loading();
this.wsChatMethodsService.getDmRoom(roomId).send({
this.wsChatMethodsService.getGroupRoom(roomId).send({
file:{
"name": res.data.selected.Assunto,
"type": "application/webtrix",
@@ -632,13 +632,13 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
async addFileToChat(types: typeof FileType[] ) {
const roomId = this.roomId
const file: any = await this.fileService.getFileFromDevice(types);
const imageData = await this.fileToBase64Service.convert(file)
const formData = new FormData();
formData.append("blobFile", file);
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
"type": "application/img",
@@ -729,7 +729,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
else if (res['data'] == 'documentoGestaoDocumental') {
this.addFileWebtrix()
this.showLoader = false;
}