This commit is contained in:
Peter Maquiran
2022-02-04 07:42:43 +01:00
parent 7ee2289ca0
commit 1ffeb3df5c
7 changed files with 135 additions and 272 deletions
+8 -8
View File
@@ -32,7 +32,7 @@ import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service'
import { MessageService } from 'src/app/services/chat/message.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { FileSystemService } from 'src/app/services/file-system.service';
import { CameraService } from 'src/app/services/camera.service';
import { element } from 'protractor';
import { FileType } from 'src/app/models/fileType';
@@ -108,7 +108,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private sqlservice: SqliteService,
public wsChatMethodsService: WsChatMethodsService,
private AttachmentsService: AttachmentsService,
private FileSystemService: FileSystemService,
private CameraService: CameraService,
private processesService: ProcessesService,
private storage: Storage,
@@ -522,9 +522,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const roomId = this.roomId
const image = await this.CameraService.takePicture();
await this.FileSystemService.saveImage(image, roomId)
const lastphoto: any = await this.FileSystemService.loadFiles(roomId);
const { capturedImage, capturedImageTitle} = await this.FileSystemService.loadFileData(lastphoto, roomId);
await this.fileService.saveImage(image)
const lastphoto: any = await this.fileService.loadFiles();
const { capturedImage, capturedImageTitle} = await this.fileService.loadFileData(lastphoto);
const { message, updateMessage} = this.wsChatMethodsService.getDmRoom(this.roomId).send({
file: {
@@ -712,9 +712,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
else if (res['data'] == 'take-picture') {
const image = await this.CameraService.takePicture();
await this.FileSystemService.saveImage(image, roomId)
const lastphoto: any = await this.FileSystemService.loadFiles(roomId);
const { capturedImage, capturedImageTitle} = await this.FileSystemService.loadFileData(lastphoto, roomId);
await this.fileService.saveImage(image)
const lastphoto: any = await this.fileService.loadFiles();
const { capturedImage, capturedImageTitle} = await this.fileService.loadFileData(lastphoto);
const base64 = await fetch(capturedImage);
const blob = await base64.blob();