mirror of https://github.com/BTCPrivate/copay.git
Fix auto-logout after scan a QR
This commit is contained in:
parent
1e071e8215
commit
c187c0fb03
|
@ -99,14 +99,21 @@ angular.module('copayApp.controllers').controller('JoinController',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.scannerIntent = function() {
|
$scope.scannerIntent = function() {
|
||||||
|
window.usingCamera = true;
|
||||||
cordova.plugins.barcodeScanner.scan(
|
cordova.plugins.barcodeScanner.scan(
|
||||||
function onSuccess(result) {
|
function onSuccess(result) {
|
||||||
|
$timeout(function(){
|
||||||
|
window.usingCamera = false;
|
||||||
|
}, 100);
|
||||||
if (result.cancelled) return;
|
if (result.cancelled) return;
|
||||||
|
|
||||||
$scope.connectionId = result.text;
|
$scope.connectionId = result.text;
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
},
|
},
|
||||||
function onError(error) {
|
function onError(error) {
|
||||||
|
$timeout(function(){
|
||||||
|
window.usingCamera = false;
|
||||||
|
}, 100);
|
||||||
alert('Scanning error');
|
alert('Scanning error');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,8 +285,12 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.scannerIntent = function() {
|
$scope.scannerIntent = function() {
|
||||||
|
window.usingCamera = true;
|
||||||
cordova.plugins.barcodeScanner.scan(
|
cordova.plugins.barcodeScanner.scan(
|
||||||
function onSuccess(result) {
|
function onSuccess(result) {
|
||||||
|
$timeout(function(){
|
||||||
|
window.usingCamera = false;
|
||||||
|
}, 100);
|
||||||
if (result.cancelled) return;
|
if (result.cancelled) return;
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
@ -298,6 +302,9 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
function onError(error) {
|
function onError(error) {
|
||||||
|
$timeout(function(){
|
||||||
|
window.usingCamera = false;
|
||||||
|
}, 100);
|
||||||
alert('Scanning error');
|
alert('Scanning error');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@ angular.element(document).ready(function() {
|
||||||
document.addEventListener('deviceready', function() {
|
document.addEventListener('deviceready', function() {
|
||||||
|
|
||||||
document.addEventListener('pause', function() {
|
document.addEventListener('pause', function() {
|
||||||
window.location = '#!';
|
if (!window.usingCamera) {
|
||||||
|
window.location = '#!';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
Loading…
Reference in New Issue