Add partial backup at create and join
This commit is contained in:
parent
137e9ca108
commit
f9fad5d62f
3 changed files with 8 additions and 4 deletions
|
|
@ -81,6 +81,7 @@ angular.module('copayApp.controllers').controller('SetupController',
|
|||
passphrase: passphrase,
|
||||
};
|
||||
var w = walletFactory.create(opts);
|
||||
backupService.download(w);
|
||||
controllerUtils.startNetwork(w, $scope);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ angular.module('copayApp.controllers').controller('SigninController',
|
|||
notification.error('Unknown error');
|
||||
controllerUtils.onErrorDigest();
|
||||
} else {
|
||||
backupService.download(w);
|
||||
controllerUtils.startNetwork(w, $scope);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,10 +11,12 @@ BackupService.prototype.getName = function(wallet) {
|
|||
|
||||
BackupService.prototype.download = function(wallet) {
|
||||
var ew = wallet.toEncryptedObj();
|
||||
var timestamp = +(new Date());
|
||||
var walletName = this.getName(wallet);
|
||||
var filename = walletName + '-' + timestamp + '-keybackup.json.aes';
|
||||
this.notifications.success('Backup created', 'Encrypted backup file saved.');
|
||||
var partial = !wallet.publicKeyRing.isComplete();
|
||||
var walletName = this.getName(wallet) + (partial ? '-Partial' : '');
|
||||
var filename = walletName + '-keybackup.json.aes';
|
||||
|
||||
var notify = partial ? 'Partial backup created' : 'Backup created';
|
||||
this.notifications.success(notify, 'Encrypted backup file saved.');
|
||||
var blob = new Blob([ew], {
|
||||
type: 'text/plain;charset=utf-8'
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue