From 8ca4d04c114ab599344eedc39d27f0e88fa09072 Mon Sep 17 00:00:00 2001 From: Joao Leonardo Pereira Date: Sun, 21 Jul 2024 10:56:18 -0300 Subject: [PATCH] stop camera on modal dismiss --- src/app/home/home.page.html | 2 +- src/app/home/home.page.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 91adc9b..d41ba57 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -31,7 +31,7 @@ - + diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index c42153e..607c4cc 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -160,6 +160,9 @@ export class HomePage implements OnInit { this.manualInput = false this.isAddAccountModalOpen = false this.isScanActive = false + if(this.qrscanner) { + this.qrscanner.stop() + } // clear form this.validations_form.reset() this.draftLogoURL = '' @@ -167,6 +170,12 @@ export class HomePage implements OnInit { this.searchLogoResults = [] } + onWillDismissModal(e: Event) { + if(this.qrscanner) { + this.qrscanner.stop() + } + } + async closeAddAccountModal() { await this.modal.dismiss() }