From 80483ba76fcddc7470377af7fa35946355c7d964 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Fri, 23 Jul 2021 21:21:16 +0200 Subject: [PATCH] Start with camera off --- BTCPayServer/Views/Shared/CameraScanner.cshtml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/Views/Shared/CameraScanner.cshtml b/BTCPayServer/Views/Shared/CameraScanner.cshtml index 305fd16a8..07b5e7095 100644 --- a/BTCPayServer/Views/Shared/CameraScanner.cshtml +++ b/BTCPayServer/Views/Shared/CameraScanner.cshtml @@ -79,7 +79,7 @@ function initCameraScanningApp(title, onDataSubmit, modalId) { errorMessage: null, workload: [], camera: 0, - cameraOff: false, + cameraOff: true, cameras: ["auto"], decoder: null } @@ -87,10 +87,11 @@ function initCameraScanningApp(title, onDataSubmit, modalId) { mounted() { if (this.isModal) { const modal = document.getElementById(this.modalId); - modal.addEventListener('shown.bs.modal', () => { this.isLoaded = true; }); - modal.addEventListener('hide.bs.modal', () => { this.isLoaded = false; }); + modal.addEventListener('shown.bs.modal', () => { this.isLoaded = true; this.cameraOff = false; }); + modal.addEventListener('hide.bs.modal', () => { this.isLoaded = false; this.cameraOff = true; }); } else { this.isLoaded = true; + this.cameraOff = false; } }, computed: {