diff --git a/js/controllers/more.js b/js/controllers/more.js index 242284a6d..f271ce7e6 100644 --- a/js/controllers/more.js +++ b/js/controllers/more.js @@ -158,12 +158,11 @@ angular.module('copayApp.controllers').controller('MoreController', window.plugins.toast.showShortCenter('Preparing backup...'); var name = (w.name || w.id); var ew = backupService.walletEncrypted(w); - var filename = name + '-keybackup.json.aes'; var properties = { subject: 'Copay Wallet Backup: ' + name, body: 'Here is the encrypted backup of the wallet ' + name + ': \n\n' + ew - + '\n\n To import this backup, copy all text between {...}, inclusive the symbols {}', + + '\n\n To import this backup, copy all text between {...}, including the symbols {}', isHtml: false }; window.plugin.email.open(properties); diff --git a/js/controllers/profile.js b/js/controllers/profile.js index be37345a2..52bc5149b 100644 --- a/js/controllers/profile.js +++ b/js/controllers/profile.js @@ -12,10 +12,31 @@ angular.module('copayApp.controllers').controller('ProfileController', function( }; $scope.viewProfileBackup = function() { - $scope.backupProfilePlainText = backupService.profileEncrypted($rootScope.iden); - $scope.hideViewProfileBackup = true; + $scope.loading = true; + $timeout(function() { + $scope.backupProfilePlainText = backupService.profileEncrypted($rootScope.iden); + }, 100); }; + $scope.copyProfileBackup = function() { + var ep = backupService.profileEncrypted($rootScope.iden); + window.cordova.plugins.clipboard.copy(ep); + window.plugins.toast.showShortCenter('Copied to clipboard'); + }; + + $scope.sendProfileBackup = function() { + window.plugins.toast.showShortCenter('Preparing backup...'); + var name = $rootScope.iden.fullName; + var ep = backupService.profileEncrypted($rootScope.iden); + var properties = { + subject: 'Copay Profile Backup: ' + name, + body: 'Here is the encrypted backup of the profile ' + + name + ': \n\n' + ep + + '\n\n To import this backup, copy all text between {...}, including the symbols {}', + isHtml: false + }; + window.plugin.email.open(properties); + }; $scope.init = function() { if ($rootScope.quotaPerItem) { diff --git a/views/more.html b/views/more.html index 2e5664139..58301d014 100644 --- a/views/more.html +++ b/views/more.html @@ -56,7 +56,7 @@ + ng-show="isSafari && !isCordova"> View backup