Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Remove flag control #853

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions www/barcodescanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

var exec = cordova.require("cordova/exec");

var scanInProgress = false;

/**
* Constructor.
Expand Down Expand Up @@ -104,24 +103,16 @@ BarcodeScanner.prototype.scan = function (successCallback, errorCallback, config
return;
}

if (scanInProgress) {
errorCallback('Scan is already in progress');
return;
}

scanInProgress = true;

exec(
function(result) {
scanInProgress = false;
// work around bug in ZXing library
if (result.format === 'UPC_A' && result.text.length === 13) {
result.text = result.text.substring(1);
}
successCallback(result);
},
function(error) {
scanInProgress = false;
errorCallback(error);
},
'BarcodeScanner',
Expand Down