From 4a9a039f12164d8e94e115c56fd096efa835d10b Mon Sep 17 00:00:00 2001 From: Lorenzo Zolfanelli Date: Sun, 22 Jan 2023 07:02:02 +0100 Subject: [PATCH] Fixes/657 (#671) * fix: do not access sectionSwap when not existing Fixes #657 * update minified js * revert minified js because of codacy warnings --- src/html5-qrcode-scanner.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/html5-qrcode-scanner.ts b/src/html5-qrcode-scanner.ts index a95a8e8..9cb5b89 100644 --- a/src/html5-qrcode-scanner.ts +++ b/src/html5-qrcode-scanner.ts @@ -1020,13 +1020,15 @@ export class Html5QrcodeScanner { } private showHideScanTypeSwapLink(shouldDisplay?: boolean) { - if (shouldDisplay !== true) { - shouldDisplay = false; - } + if (this.scanTypeSelector.hasMoreThanOneScanType()) { + if (shouldDisplay !== true) { + shouldDisplay = false; + } - this.sectionSwapAllowed = shouldDisplay; - this.getDashboardSectionSwapLink().style.display - = shouldDisplay ? "inline-block" : "none"; + this.sectionSwapAllowed = shouldDisplay; + this.getDashboardSectionSwapLink().style.display + = shouldDisplay ? "inline-block" : "none"; + } } private insertCameraScanImageToScanRegion() {