From 2d11555eab5fdbe712fe7d9373616ecef585a27b Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 29 Jan 2015 16:03:14 -0200 Subject: [PATCH 1/2] Not pause the device if user share or send the backup by email --- js/controllers/more.js | 1 + js/controllers/profile.js | 1 + js/controllers/receive.js | 3 ++- js/init.js | 6 ++++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/js/controllers/more.js b/js/controllers/more.js index f271ce7e6..6a502c174 100644 --- a/js/controllers/more.js +++ b/js/controllers/more.js @@ -155,6 +155,7 @@ angular.module('copayApp.controllers').controller('MoreController', }; $scope.sendWalletBackup = function() { + window.ignoreMobilePause = true; window.plugins.toast.showShortCenter('Preparing backup...'); var name = (w.name || w.id); var ew = backupService.walletEncrypted(w); diff --git a/js/controllers/profile.js b/js/controllers/profile.js index 52bc5149b..d73d32d9e 100644 --- a/js/controllers/profile.js +++ b/js/controllers/profile.js @@ -25,6 +25,7 @@ angular.module('copayApp.controllers').controller('ProfileController', function( }; $scope.sendProfileBackup = function() { + window.ignoreMobilePause = true; window.plugins.toast.showShortCenter('Preparing backup...'); var name = $rootScope.iden.fullName; var ep = backupService.profileEncrypted($rootScope.iden); diff --git a/js/controllers/receive.js b/js/controllers/receive.js index a8bd07a20..8fb8333f3 100644 --- a/js/controllers/receive.js +++ b/js/controllers/receive.js @@ -19,7 +19,8 @@ angular.module('copayApp.controllers').controller('ReceiveController', $scope.shareAddress = function(addr) { if (isCordova) { - window.plugins.socialsharing.share('My bitcoin address: ' + addr); + window.ignoreMobilePause = true; + window.plugins.socialsharing.share('My bitcoin address: ' + addr, null, null, null); } }; diff --git a/js/init.js b/js/init.js index d6677d3a8..b64bef7db 100644 --- a/js/init.js +++ b/js/init.js @@ -16,6 +16,12 @@ angular.element(document).ready(function() { window.location = '#!/signout'; } }, false); + + document.addEventListener('resume', function() { + setTimeout(function() { + window.ignoreMobilePause = false; + }, 100); + }, false); document.addEventListener('backbutton', function() { window.location = '#!/homeWallet'; From 71db4d05f9d665671db440e6143e388ae7e82dba Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 29 Jan 2015 15:22:15 -0300 Subject: [PATCH 2/2] Fix pause for iOS --- js/controllers/more.js | 4 +++- js/controllers/profile.js | 4 +++- js/controllers/receive.js | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/controllers/more.js b/js/controllers/more.js index 6a502c174..499bb6e5d 100644 --- a/js/controllers/more.js +++ b/js/controllers/more.js @@ -155,7 +155,9 @@ angular.module('copayApp.controllers').controller('MoreController', }; $scope.sendWalletBackup = function() { - window.ignoreMobilePause = true; + if (!isMobile.iOS) { + window.ignoreMobilePause = true; + } window.plugins.toast.showShortCenter('Preparing backup...'); var name = (w.name || w.id); var ew = backupService.walletEncrypted(w); diff --git a/js/controllers/profile.js b/js/controllers/profile.js index d73d32d9e..7bdc2525b 100644 --- a/js/controllers/profile.js +++ b/js/controllers/profile.js @@ -25,7 +25,9 @@ angular.module('copayApp.controllers').controller('ProfileController', function( }; $scope.sendProfileBackup = function() { - window.ignoreMobilePause = true; + if (!isMobile.iOS) { + window.ignoreMobilePause = true; + } window.plugins.toast.showShortCenter('Preparing backup...'); var name = $rootScope.iden.fullName; var ep = backupService.profileEncrypted($rootScope.iden); diff --git a/js/controllers/receive.js b/js/controllers/receive.js index 8fb8333f3..7be9d5b75 100644 --- a/js/controllers/receive.js +++ b/js/controllers/receive.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('ReceiveController', - function($scope, $rootScope, $timeout, $modal, isCordova) { + function($scope, $rootScope, $timeout, $modal, isCordova, isMobile) { $scope.newAddr = function() { var w = $rootScope.wallet; @@ -19,7 +19,9 @@ angular.module('copayApp.controllers').controller('ReceiveController', $scope.shareAddress = function(addr) { if (isCordova) { - window.ignoreMobilePause = true; + if (!isMobile.iOS) { + window.ignoreMobilePause = true; + } window.plugins.socialsharing.share('My bitcoin address: ' + addr, null, null, null); } };