Merge pull request #2133 from cmgustavo/bug/android-import
import profile/wallet on android
This commit is contained in:
commit
97bcd37aa4
5 changed files with 23 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('ImportController',
|
angular.module('copayApp.controllers').controller('ImportController',
|
||||||
function($scope, $rootScope, $location, identityService, notification, isMobile, Compatibility) {
|
function($scope, $rootScope, $location, $timeout, identityService, notification, isMobile, Compatibility) {
|
||||||
|
|
||||||
$rootScope.title = 'Import wallet';
|
$rootScope.title = 'Import wallet';
|
||||||
$scope.importStatus = 'Importing wallet - Reading backup...';
|
$scope.importStatus = 'Importing wallet - Reading backup...';
|
||||||
|
|
@ -9,6 +9,13 @@ angular.module('copayApp.controllers').controller('ImportController',
|
||||||
$scope.is_iOS = isMobile.iOS();
|
$scope.is_iOS = isMobile.iOS();
|
||||||
$scope.importOpts = {};
|
$scope.importOpts = {};
|
||||||
|
|
||||||
|
window.ignoreMobilePause = true;
|
||||||
|
$scope.$on('$destroy', function() {
|
||||||
|
$timeout(function(){
|
||||||
|
window.ignoreMobilePause = false;
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
|
||||||
Compatibility.check($scope);
|
Compatibility.check($scope);
|
||||||
|
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,19 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('ImportProfileController',
|
angular.module('copayApp.controllers').controller('ImportProfileController',
|
||||||
function($scope, $rootScope, $location, notification, isMobile, identityService) {
|
function($scope, $rootScope, $location, $timeout, notification, isMobile, identityService) {
|
||||||
$scope.title = 'Import a backup';
|
$scope.title = 'Import a backup';
|
||||||
$scope.importStatus = 'Importing wallet - Reading backup...';
|
$scope.importStatus = 'Importing wallet - Reading backup...';
|
||||||
$scope.hideAdv = true;
|
$scope.hideAdv = true;
|
||||||
$scope.is_iOS = isMobile.iOS();
|
$scope.is_iOS = isMobile.iOS();
|
||||||
|
|
||||||
|
window.ignoreMobilePause = true;
|
||||||
|
$scope.$on('$destroy', function() {
|
||||||
|
$timeout(function(){
|
||||||
|
window.ignoreMobilePause = false;
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
|
||||||
var updateStatus = function(status) {
|
var updateStatus = function(status) {
|
||||||
|
|
|
||||||
|
|
@ -99,11 +99,11 @@ angular.module('copayApp.controllers').controller('JoinController',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.scannerIntent = function() {
|
$scope.scannerIntent = function() {
|
||||||
window.usingCamera = true;
|
window.ignoreMobilePause = true;
|
||||||
cordova.plugins.barcodeScanner.scan(
|
cordova.plugins.barcodeScanner.scan(
|
||||||
function onSuccess(result) {
|
function onSuccess(result) {
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
window.usingCamera = false;
|
window.ignoreMobilePause = false;
|
||||||
}, 100);
|
}, 100);
|
||||||
if (result.cancelled) return;
|
if (result.cancelled) return;
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ angular.module('copayApp.controllers').controller('JoinController',
|
||||||
},
|
},
|
||||||
function onError(error) {
|
function onError(error) {
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
window.usingCamera = false;
|
window.ignoreMobilePause = false;
|
||||||
}, 100);
|
}, 100);
|
||||||
alert('Scanning error');
|
alert('Scanning error');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -285,11 +285,11 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.scannerIntent = function() {
|
$scope.scannerIntent = function() {
|
||||||
window.usingCamera = true;
|
window.ignoreMobilePause = true;
|
||||||
cordova.plugins.barcodeScanner.scan(
|
cordova.plugins.barcodeScanner.scan(
|
||||||
function onSuccess(result) {
|
function onSuccess(result) {
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
window.usingCamera = false;
|
window.ignoreMobilePause = false;
|
||||||
}, 100);
|
}, 100);
|
||||||
if (result.cancelled) return;
|
if (result.cancelled) return;
|
||||||
|
|
||||||
|
|
@ -303,7 +303,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
},
|
},
|
||||||
function onError(error) {
|
function onError(error) {
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
window.usingCamera = false;
|
window.ignoreMobilePause = false;
|
||||||
}, 100);
|
}, 100);
|
||||||
alert('Scanning error');
|
alert('Scanning error');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ angular.element(document).ready(function() {
|
||||||
document.addEventListener('deviceready', function() {
|
document.addEventListener('deviceready', function() {
|
||||||
|
|
||||||
document.addEventListener('pause', function() {
|
document.addEventListener('pause', function() {
|
||||||
if (!window.usingCamera) {
|
if (!window.ignoreMobilePause) {
|
||||||
window.location = '#!';
|
window.location = '#!';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue