Merge pull request #5440 from bitjson/bug/desktop-scanner

Improve scanner handling on all platforms
This commit is contained in:
Gustavo Maximiliano Cortez 2017-01-24 14:38:30 -03:00 committed by GitHub
commit cfb22c2acd
2 changed files with 15 additions and 12 deletions

View file

@ -57,8 +57,10 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
$scope.$on("$ionicView.afterEnter", function() {
// try initializing and refreshing status any time the view is entered
scannerService.gentleInitialize();
scannerService.resumePreview();
if(!scannerService.isInitialized()){
scannerService.gentleInitialize();
}
activate();
});
function activate(){
@ -79,6 +81,8 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
handleSuccessfulScan(contents);
}
});
// resume preview if paused
scannerService.resumePreview();
});
});
}
@ -101,7 +105,6 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
}
$rootScope.$on('incomingDataMenu.menuHidden', function() {
scannerService.resumePreview();
activate();
});