Fix backup for iOS
This commit is contained in:
parent
22b7a6da68
commit
74174f9775
6 changed files with 44 additions and 7 deletions
|
|
@ -5,6 +5,15 @@ angular.module('copayApp.controllers').controller('CopayersController',
|
|||
$scope.isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
|
||||
$scope.hideAdv = true;
|
||||
|
||||
$scope.sendEmail = function(backupPlainText) {
|
||||
var w = $rootScope.wallet;
|
||||
var link = 'mailto:'
|
||||
+ '?subject=' + escape(backupService.getFilename(w))
|
||||
+ '&body=' + escape(backupPlainText) + '';
|
||||
|
||||
window.location.href = link;
|
||||
};
|
||||
|
||||
$scope.skipBackup = function() {
|
||||
var w = $rootScope.wallet;
|
||||
w.setBackupReady(true);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,15 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
decimals: 8
|
||||
}];
|
||||
|
||||
$scope.sendEmail = function(backupPlainText) {
|
||||
var w = $rootScope.wallet;
|
||||
var link = 'mailto:'
|
||||
+ '?subject=' + escape(backupService.getFilename(w))
|
||||
+ '&body=' + escape(backupPlainText) + '';
|
||||
|
||||
window.location.href = link;
|
||||
};
|
||||
|
||||
$scope.selectedAlternative = {
|
||||
name: w.settings.alternativeName,
|
||||
isoCode: w.settings.alternativeIsoCode
|
||||
|
|
|
|||
|
|
@ -17,11 +17,15 @@ BackupService.prototype.getBackup = function(wallet) {
|
|||
return wallet.toEncryptedObj();
|
||||
};
|
||||
|
||||
BackupService.prototype.download = function(wallet) {
|
||||
var ew = this.getBackup(wallet);
|
||||
BackupService.prototype.getFilename = function(wallet) {
|
||||
var walletName = this.getName(wallet);
|
||||
var copayerName = this.getCopayer(wallet);
|
||||
var filename = (copayerName ? copayerName + '-' : '') + walletName + '-keybackup.json.aes';
|
||||
return (copayerName ? copayerName + '-' : '') + walletName + '-keybackup.json.aes';
|
||||
};
|
||||
|
||||
BackupService.prototype.download = function(wallet) {
|
||||
var ew = this.getBackup(wallet);
|
||||
var filename = this.getFilename(wallet);
|
||||
|
||||
this.notifications.success('Backup created', 'Encrypted backup file saved');
|
||||
var blob = new Blob([ew], {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue