Fix auto-logout after scan a QR

This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-12 15:07:48 -03:00
commit c187c0fb03
3 changed files with 17 additions and 1 deletions

View file

@ -99,14 +99,21 @@ angular.module('copayApp.controllers').controller('JoinController',
};
$scope.scannerIntent = function() {
window.usingCamera = true;
cordova.plugins.barcodeScanner.scan(
function onSuccess(result) {
$timeout(function(){
window.usingCamera = false;
}, 100);
if (result.cancelled) return;
$scope.connectionId = result.text;
$rootScope.$digest();
},
function onError(error) {
$timeout(function(){
window.usingCamera = false;
}, 100);
alert('Scanning error');
});
}