Disconnect, Offline storage and retry
Dear Pape thanks for this wonderful code.
I am trying your lib because of its developer friendlier , for me internet connectivity is not very reliable, so its causing some issues.
- Could you please add/show an option to dual-save the scans offline or
localstorage in-case the browserdisconnects. Or share a small sample on how I could achieve this in your lib. - Is there a debug/option to show the scanner is in ready/
onlineor acquired mode. I have an indicator/textbox ontop, which I change to green when the scanner is connected.
thanks
Asked by @unitedbummersconference here: https://github.com/pape-io/barcode-scanner.js/issues/3#issuecomment-161124622
Hi, for me on disconnects
<form> <input data-barcode-scanner-target type='text' class="pape-save-offline-barcode"></input> </form> $('form').on('submit', function(e){ e.preventDefault(); SaveToOffline(); SeverBatchUpload(); });totally bombs out on me,would be supeer sweet, if this was an option
As I want this library to focus on the detection, it's unlikely that I will store them locally in case of bad connection. Thats something your app should take care of, and obviously from your source code, you already solved that problem, don't you?
The library cannot detect if the scanner is ready/online. In general web applications cannot detect if a scanner is connected via usb.
For retrying simply use a retrying library like: https://github.com/johnkpaul/jquery-ajax-retry
I would like to vote this up too :+1: