Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #266 from daserge/multiple-focus-3
Browse files Browse the repository at this point in the history
[Windows] Focus fails on multiple taps
  • Loading branch information
Sergey Shakhnazarov authored Jun 23, 2016
2 parents 78a5345 + f18ed1a commit d92af72
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/windows/BarcodeScannerProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,16 @@ module.exports = {
return WinJS.Promise.timeout(INITIAL_FOCUS_DELAY)
.then(function () {
try {
return controller.focusControl.focusAsync();
return controller.focusControl.focusAsync().then(function () {
return result;
}, function (e) {
// This happens on mutliple taps
if (e.number !== OPERATION_IS_IN_PROGRESS) {
console.error('focusAsync failed: ' + e);
return WinJS.Promise.wrapError(e);
}
return result;
});
} catch (e) {
// This happens on mutliple taps
if (e.number !== OPERATION_IS_IN_PROGRESS) {
Expand Down

0 comments on commit d92af72

Please sign in to comment.