fix mobile scanner when QR code is a paypro

This commit is contained in:
Gustavo Maximiliano Cortez 2014-11-27 11:43:44 -03:00
parent f329284210
commit a08695e94e
2 changed files with 9 additions and 11 deletions

View File

@ -941,7 +941,7 @@ input[type='submit']
input[type=date], input[type=datetime-local], input[type=datetime], input[type=email], input[type=month], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], input[type=week], textarea {
color: #7A8C9E;
color: #343c43;
margin-bottom: 1.3rem;
height: 40px;
border-radius: 2px;

View File

@ -26,6 +26,7 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.rateService = rateService;
$scope.showScanner = false;
$scope.myId = w.getMyCopayerId();
$scope.isMobile = isMobile.any();
rateService.whenAvailable(function() {
$scope.isRateAvailable = true;
@ -96,7 +97,6 @@ angular.module('copayApp.controllers').controller('SendController',
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
$scope.isMobile = isMobile.any();
if (!window.cordova && !navigator.getUserMedia)
$scope.disableScanner = 1;
@ -287,15 +287,13 @@ angular.module('copayApp.controllers').controller('SendController',
function onSuccess(result) {
if (result.cancelled) return;
var bip21 = new bitcore.BIP21(result.text);
$scope.address = bip21.address + '';
$scope.commentText = bip21.data.message;
if (bip21.data.amount) {
$scope.amount = bip21.data.amount * bitcore.util.COIN * satToUnit;
}
$rootScope.$digest();
$timeout(function() {
var data = result.text;
$scope.$apply(function() {
$scope.sendForm.address.$setViewValue(result.text);
$scope.sendForm.address.$render();
});
}, 1000);
},
function onError(error) {
alert('Scanning error');