mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add picture from gallery on chat grup solved
This commit is contained in:
@@ -747,6 +747,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async addFileToChatMobile(types: typeof FileType[]) {
|
||||
console.log('add image from gallery')
|
||||
const roomId = this.roomId
|
||||
|
||||
const file = await Camera.getPhoto({
|
||||
@@ -819,7 +820,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async addFileToChat(types: typeof FileType[]) {
|
||||
|
||||
console.log('add file')
|
||||
const roomId = this.roomId
|
||||
|
||||
const file: any = await this.fileService.getFileFromDevice(types);
|
||||
@@ -837,6 +838,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
console.log('add file', fileBase64)
|
||||
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
@@ -855,7 +857,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
console.log('file not supported')
|
||||
}
|
||||
|
||||
|
||||
@@ -901,6 +903,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.takePicture()
|
||||
}
|
||||
else if (res['data'] == 'add-picture') {
|
||||
console.log('add-picture')
|
||||
this.addImageMobile()
|
||||
}
|
||||
else if (res['data'] == 'add-document') {
|
||||
@@ -1041,7 +1044,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
await Filesystem.writeFile({
|
||||
path: fileName,
|
||||
data: pdfString,
|
||||
directory: Directory.Documents,
|
||||
directory: Directory.Data,
|
||||
}).then((dir) => {
|
||||
console.log('DIR ', dir)
|
||||
this.fileOpener
|
||||
|
||||
Reference in New Issue
Block a user