From 017ed6a1e444d5772ff47d3b7404273c314fea04 Mon Sep 17 00:00:00 2001 From: OS-pedrogustavobilro Date: Tue, 17 Dec 2024 18:28:05 +0000 Subject: [PATCH] fix: Listen to cancel event on PWA camera photo prompt Requires https://github.com/ionic-team/pwa-elements/pull/138 --- camera/src/web.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/camera/src/web.ts b/camera/src/web.ts index 9c9dfae53..1870d1a03 100644 --- a/camera/src/web.ts +++ b/camera/src/web.ts @@ -36,6 +36,9 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { this.cameraExperience(options, resolve, reject); } }); + actionSheet.addEventListener('onCanceled', async () => { + reject(new CapacitorException('User cancelled photos app')); + }); } else { this.cameraExperience(options, resolve, reject); }