You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, I do not sleep for several days. I tested several Qr readers and the only one I found interesting was this one, to perform a quick reading, it is necessary to decrease "delay", the same Qr is repeated several times.
The solution I found for not to repeat for a certain time:
bundle.js > add rows the top:
var arrayResult = [];
var timeoutResult;
function removeA(arr) {
var what, a = arguments, L = a.length, ax;
while (L > 1 && arr.length) {
what = a[--L];
while ((ax= arr.indexOf(what)) !== -1) {
arr.splice(ax, 1);
}
}
return arr;
}
function timeout(arrayResult, result) {
timeoutResult = window.setTimeout(function(){
removeA(arrayResult, result);
}, 5000);
}
function clearResultTimeout() {
clearTimeout(timeoutResult);
}
function insereValor(result) {
if (arrayResult.indexOf(result) < 0){
clearResultTimeout(); // delete timeout from (result) previous
arrayResult.shift(); // remove lock (result) previous
arrayResult.push(result); // add lock (result) current
this.setState({ result: result }); // result
timeout(arrayResult, result); // setTimeout
}else{
//alert(result); // lockout timeout
}
}
bundle.js > search by for lines:
value: function handleScan(result) {
if (result) {
this.setState({ result: result });
}
}
bundle.js > change to:
value: function handleScan(result) {
if (result) {
insereValor(result);
}
}
Is the reading happens faster and if the QR is repeated, it is discarded for 5 seconds.
The text was updated successfully, but these errors were encountered:
Well, I do not sleep for several days. I tested several Qr readers and the only one I found interesting was this one, to perform a quick reading, it is necessary to decrease "delay", the same Qr is repeated several times.
The solution I found for not to repeat for a certain time:
The text was updated successfully, but these errors were encountered: