Commit ba3d6e4
committed
[FIX] web: barcode video scanner double scan
Before this commit, using the `BarcodeVideoScanner` component, it could
happen the same barcode is scanned multiple times even if a
`delayBetweenScan` is set.
My guess is the `detectCode` interval has the time to be called once
again before `barcodeDetected` pauses it, which could explain why this
bug happens only on some device (slower devices.)
To fix this issue, interval is replaced by a timeout, and timeout is
re-created every time only when needed (so, it is not recreated
immediately if a pause is needed.)
closes odoo#176569
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>1 parent 26ee3c0 commit ba3d6e4
File tree
1 file changed
+11
-8
lines changed- addons/web/static/src/webclient/barcode
1 file changed
+11
-8
lines changedLines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 132 | + | |
135 | 133 | | |
136 | 134 | | |
| 135 | + | |
137 | 136 | | |
138 | 137 | | |
139 | 138 | | |
| |||
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
160 | | - | |
| 162 | + | |
161 | 163 | | |
| 164 | + | |
162 | 165 | | |
163 | 166 | | |
164 | 167 | | |
| |||
0 commit comments