From 58f6baf5e964abf202e8f7e93c9af818f82eb739 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Mon, 18 Jul 2022 16:22:58 +0600 Subject: [PATCH] fix(custom-camera): make sure confirm button works properly --- src/app/features/home/custom-camera/custom-camera.page.ts | 5 ++--- src/app/features/home/custom-camera/custom-camera.service.ts | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/features/home/custom-camera/custom-camera.page.ts b/src/app/features/home/custom-camera/custom-camera.page.ts index a5637af78..d7cb6a597 100644 --- a/src/app/features/home/custom-camera/custom-camera.page.ts +++ b/src/app/features/home/custom-camera/custom-camera.page.ts @@ -166,13 +166,12 @@ export class CustomCameraPage implements OnInit, OnDestroy { async confirmCurrentCapture() { if (this.curCaptureFilePath && this.curCaptureType) { - await this.customCameraService.uploadToCapture( + this.customCameraService.uploadToCapture( this.curCaptureFilePath, this.curCaptureType ); - this.removeCurrentCapture(); + this.leaveCustomCamera(); } - this.leaveCustomCamera(); } async isTorchOn() { diff --git a/src/app/features/home/custom-camera/custom-camera.service.ts b/src/app/features/home/custom-camera/custom-camera.service.ts index 9fb84450f..d9adab50d 100644 --- a/src/app/features/home/custom-camera/custom-camera.service.ts +++ b/src/app/features/home/custom-camera/custom-camera.service.ts @@ -58,6 +58,7 @@ export class CustomCameraService { const base64 = await blobToBase64(itemBlob); const mimeType = itemToUpload.mimeType; await this.captureService.capture({ base64, mimeType }); + await this.removeFile(filePath); } catch (error) { const errMsg = this.translocoService.translate(`error.internetError`); await this.errorService.toastError$(errMsg).toPromise();