From 1537d448d60997e0589e719329601bfe67763d06 Mon Sep 17 00:00:00 2001 From: LeonardoPineda Date: Fri, 22 Oct 2021 14:23:59 -0400 Subject: [PATCH 1/5] fix camera rear --- camera/src/web.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/camera/src/web.ts b/camera/src/web.ts index c7d587aa39..ecb9660606 100644 --- a/camera/src/web.ts +++ b/camera/src/web.ts @@ -47,6 +47,7 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { ) { if (customElements.get('pwa-camera-modal')) { const cameraModal: any = document.createElement('pwa-camera-modal'); + cameraModal.facingMode = options.direction === CameraDirection.Rear ? 'environment' : 'user'; document.body.appendChild(cameraModal); try { await cameraModal.componentOnReady(); From 9f10ecdad27fa76f7cde6a23bc952fbb706cfeae Mon Sep 17 00:00:00 2001 From: LeonardoPineda Date: Wed, 15 Dec 2021 18:51:36 -0400 Subject: [PATCH 2/5] fix CameraDirection default --- camera/src/web.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camera/src/web.ts b/camera/src/web.ts index d3fbf5084a..c2de104bff 100644 --- a/camera/src/web.ts +++ b/camera/src/web.ts @@ -56,7 +56,9 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { ) { if (customElements.get('pwa-camera-modal')) { const cameraModal: any = document.createElement('pwa-camera-modal'); - cameraModal.facingMode = options.direction === CameraDirection.Rear ? 'environment' : 'user'; + const value: any = {}, direction: any = options.direction; + value[CameraDirection.Front] = 'user'; + cameraModal.facingMode = direction[direction] || 'environment'; document.body.appendChild(cameraModal); try { await cameraModal.componentOnReady(); From 0f8ed04e1d71cafd980604b8f6c66614a774012c Mon Sep 17 00:00:00 2001 From: LeonardoPineda Date: Wed, 15 Dec 2021 18:51:54 -0400 Subject: [PATCH 3/5] fix CameraDirection default --- camera/src/web.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/src/web.ts b/camera/src/web.ts index c2de104bff..75f27359f7 100644 --- a/camera/src/web.ts +++ b/camera/src/web.ts @@ -58,7 +58,7 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { const cameraModal: any = document.createElement('pwa-camera-modal'); const value: any = {}, direction: any = options.direction; value[CameraDirection.Front] = 'user'; - cameraModal.facingMode = direction[direction] || 'environment'; + cameraModal.facingMode = value[direction] || 'environment'; document.body.appendChild(cameraModal); try { await cameraModal.componentOnReady(); From 9bd1ee97ec87e8bb7f9119a6e4cb27fd0503d918 Mon Sep 17 00:00:00 2001 From: LeonardoPineda Date: Thu, 16 Dec 2021 12:07:58 -0400 Subject: [PATCH 4/5] fix options direction Front --- camera/src/web.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/camera/src/web.ts b/camera/src/web.ts index 75f27359f7..ff287965a9 100644 --- a/camera/src/web.ts +++ b/camera/src/web.ts @@ -56,9 +56,7 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { ) { if (customElements.get('pwa-camera-modal')) { const cameraModal: any = document.createElement('pwa-camera-modal'); - const value: any = {}, direction: any = options.direction; - value[CameraDirection.Front] = 'user'; - cameraModal.facingMode = value[direction] || 'environment'; + cameraModal.facingMode = options.direction === CameraDirection.Front ? 'user' : 'environment'; document.body.appendChild(cameraModal); try { await cameraModal.componentOnReady(); From dda7083c89c7a5cb402643ecc211020cecd0fc64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar?= Date: Thu, 16 Dec 2021 18:20:35 +0100 Subject: [PATCH 5/5] fmt --- camera/src/web.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/camera/src/web.ts b/camera/src/web.ts index ff287965a9..9c6293056f 100644 --- a/camera/src/web.ts +++ b/camera/src/web.ts @@ -56,7 +56,8 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { ) { if (customElements.get('pwa-camera-modal')) { const cameraModal: any = document.createElement('pwa-camera-modal'); - cameraModal.facingMode = options.direction === CameraDirection.Front ? 'user' : 'environment'; + cameraModal.facingMode = + options.direction === CameraDirection.Front ? 'user' : 'environment'; document.body.appendChild(cameraModal); try { await cameraModal.componentOnReady();