Merge pull request #2367 from cmgustavo/bug/cordova-pause-resume-01

Not pause the device if user share or send the backup by email
This commit is contained in:
Matias Pando 2015-01-29 15:29:46 -03:00
commit fc824a1c11
4 changed files with 17 additions and 2 deletions

View file

@ -155,6 +155,9 @@ angular.module('copayApp.controllers').controller('MoreController',
}; };
$scope.sendWalletBackup = function() { $scope.sendWalletBackup = function() {
if (!isMobile.iOS) {
window.ignoreMobilePause = true;
}
window.plugins.toast.showShortCenter('Preparing backup...'); window.plugins.toast.showShortCenter('Preparing backup...');
var name = (w.name || w.id); var name = (w.name || w.id);
var ew = backupService.walletEncrypted(w); var ew = backupService.walletEncrypted(w);

View file

@ -25,6 +25,9 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
}; };
$scope.sendProfileBackup = function() { $scope.sendProfileBackup = function() {
if (!isMobile.iOS) {
window.ignoreMobilePause = true;
}
window.plugins.toast.showShortCenter('Preparing backup...'); window.plugins.toast.showShortCenter('Preparing backup...');
var name = $rootScope.iden.fullName; var name = $rootScope.iden.fullName;
var ep = backupService.profileEncrypted($rootScope.iden); var ep = backupService.profileEncrypted($rootScope.iden);

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('ReceiveController', angular.module('copayApp.controllers').controller('ReceiveController',
function($scope, $rootScope, $timeout, $modal, isCordova) { function($scope, $rootScope, $timeout, $modal, isCordova, isMobile) {
$scope.newAddr = function() { $scope.newAddr = function() {
var w = $rootScope.wallet; var w = $rootScope.wallet;
@ -19,7 +19,10 @@ angular.module('copayApp.controllers').controller('ReceiveController',
$scope.shareAddress = function(addr) { $scope.shareAddress = function(addr) {
if (isCordova) { if (isCordova) {
window.plugins.socialsharing.share('My bitcoin address: ' + addr); if (!isMobile.iOS) {
window.ignoreMobilePause = true;
}
window.plugins.socialsharing.share('My bitcoin address: ' + addr, null, null, null);
} }
}; };

View file

@ -17,6 +17,12 @@ angular.element(document).ready(function() {
} }
}, false); }, false);
document.addEventListener('resume', function() {
setTimeout(function() {
window.ignoreMobilePause = false;
}, 100);
}, false);
document.addEventListener('backbutton', function() { document.addEventListener('backbutton', function() {
window.location = '#!/homeWallet'; window.location = '#!/homeWallet';
}, false); }, false);