Skip to content

Commit

Permalink
Bug when scanning QR code #195
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Mar 12, 2019
1 parent 97d6efb commit 868b3ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [3.1.2](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/3.1.2) (2019-03-12)
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/38?closed=1)


## [3.1.1](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/3.1.1) (2019-03-10)
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/37?closed=1)


## [3.1.0](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/3.1.0) (2019-03-06)
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/36?closed=1)

Expand Down
7 changes: 3 additions & 4 deletions src/barcodescanner.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,14 @@ export class BarcodeScanner {
isContinuous,
arg.reportDuplicates,
arg.formats,
(text: string, format: string) => {
(text: string, barcodeFormat: BarcodeFormat) => {
// invoke the callback / promise
if (text === undefined) {
this._removeVolumeObserver();
this._closeCallback && this._closeCallback();
reject("Scan aborted");
} else {

let barcodeFormat = getBarcodeFormat(format);
let value = text;

if (shouldReturnEAN13AsUPCA(barcodeFormat, value, arg.formats)) {
Expand Down Expand Up @@ -401,7 +400,7 @@ class QRCodeReaderDelegateImpl extends NSObject implements QRCodeReaderDelegate
return delegate;
}

private _callback: (text?: string, format?: string) => void;
private _callback: (text?: string, format?: BarcodeFormat) => void;
private _beepOnScan: boolean;
private _isContinuous: boolean;
private _reportDuplicates: boolean;
Expand All @@ -411,7 +410,7 @@ class QRCodeReaderDelegateImpl extends NSObject implements QRCodeReaderDelegate
// initializing this value may prevent recognizing too quickly
private _lastScanResultTs: number = new Date().getTime();

public setCallback(beepOnScan: boolean, isContinuous: boolean, reportDuplicates: boolean, requestedFormats: string, callback: (text?: string, format?: string) => void): void {
public setCallback(beepOnScan: boolean, isContinuous: boolean, reportDuplicates: boolean, requestedFormats: string, callback: (text?: string, format?: BarcodeFormat) => void): void {
this._isContinuous = isContinuous;
this._reportDuplicates = reportDuplicates;
this._requestedFormats = requestedFormats;
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-barcodescanner",
"version": "3.1.1",
"version": "3.1.2",
"description": "Scan QR/barcodes with your NativeScript app.",
"main": "barcodescanner",
"typings": "index.d.ts",
Expand Down

0 comments on commit 868b3ec

Please sign in to comment.