mirror of https://github.com/BTCPrivate/copay.git
added auto backup after create/join
This commit is contained in:
parent
b40038a554
commit
eeb621b601
|
@ -33,7 +33,7 @@ var valid_pairs = {
|
||||||
};
|
};
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('SetupController',
|
angular.module('copayApp.controllers').controller('SetupController',
|
||||||
function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase) {
|
function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase, backupService) {
|
||||||
|
|
||||||
$rootScope.videoInfo = {};
|
$rootScope.videoInfo = {};
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
|
@ -84,6 +84,7 @@ angular.module('copayApp.controllers').controller('SetupController',
|
||||||
passphrase: passphrase,
|
passphrase: passphrase,
|
||||||
};
|
};
|
||||||
var w = walletFactory.create(opts);
|
var w = walletFactory.create(opts);
|
||||||
|
backupService.download(w);
|
||||||
controllerUtils.startNetwork(w, $scope);
|
controllerUtils.startNetwork(w, $scope);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('SigninController',
|
angular.module('copayApp.controllers').controller('SigninController',
|
||||||
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
|
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, backupService) {
|
||||||
var cmp = function(o1, o2) {
|
var cmp = function(o1, o2) {
|
||||||
var v1 = o1.show.toLowerCase(),
|
var v1 = o1.show.toLowerCase(),
|
||||||
v2 = o2.show.toLowerCase();
|
v2 = o2.show.toLowerCase();
|
||||||
|
|
|
@ -10,7 +10,7 @@ BackupService.prototype.download = function(wallet) {
|
||||||
var ew = wallet.toEncryptedObj();
|
var ew = wallet.toEncryptedObj();
|
||||||
var timestamp = +(new Date());
|
var timestamp = +(new Date());
|
||||||
var walletName = this.getName(wallet);
|
var walletName = this.getName(wallet);
|
||||||
var filename = walletName + '-' + timestamp + '.json.aes';
|
var filename = walletName + '-' + timestamp + '-keybackup.json.aes';
|
||||||
var blob = new Blob([ew], {
|
var blob = new Blob([ew], {
|
||||||
type: 'text/plain;charset=utf-8'
|
type: 'text/plain;charset=utf-8'
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue