Skip to content

Commit

Permalink
Merge pull request #1 from growthcone/swip_cancel
Browse files Browse the repository at this point in the history
スワイプキャンセルの対処
  • Loading branch information
yudateNoriyuki authored Jul 14, 2023
2 parents bd82b3f + 1f0fbfc commit 6012f7f
Showing 1 changed file with 0 additions and 9 deletions.
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

0 comments on commit 6012f7f

Please sign in to comment.