fix: publish `detected` event for `multiple`

pull/90/head
dgreif 10 years ago
parent 74c4f04a07
commit 9a9b8de4bc

@ -220,6 +220,12 @@ function addResult (result, imageData) {
}
}
function hasCodeResult (result) {
return result && result.barcodes ?
result.barcodes.some(barcode => barcode.codeResult) :
result.codeResult;
}
function publishResult(result, imageData) {
if (result && _onUIThread) {
transformResult(result);
@ -227,7 +233,7 @@ function publishResult(result, imageData) {
}
Events.publish("processed", result);
if (result && result.codeResult) {
if (hasCodeResult(result)) {
Events.publish("detected", result);
}
}

Loading…
Cancel
Save