Skip to content

Commit

Permalink
Fixes/657 (mebjas#671)
Browse files Browse the repository at this point in the history
* fix: do not access sectionSwap when not existing

Fixes mebjas#657

* update minified js

* revert minified js because of codacy warnings
  • Loading branch information
zolfariot authored Jan 22, 2023
1 parent 7f57cad commit 4a9a039
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/html5-qrcode-scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4a9a039

Please sign in to comment.