added auto backup after create/join

This commit is contained in:
Manuel Araoz 2014-06-16 16:54:50 -03:00
parent b40038a554
commit eeb621b601
3 changed files with 4 additions and 3 deletions

View File

@ -33,7 +33,7 @@ var valid_pairs = {
};
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 = {};
$scope.loading = false;
@ -84,6 +84,7 @@ angular.module('copayApp.controllers').controller('SetupController',
passphrase: passphrase,
};
var w = walletFactory.create(opts);
backupService.download(w);
controllerUtils.startNetwork(w, $scope);
});
};

View File

@ -1,7 +1,7 @@
'use strict';
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 v1 = o1.show.toLowerCase(),
v2 = o2.show.toLowerCase();

View File

@ -10,7 +10,7 @@ BackupService.prototype.download = function(wallet) {
var ew = wallet.toEncryptedObj();
var timestamp = +(new Date());
var walletName = this.getName(wallet);
var filename = walletName + '-' + timestamp + '.json.aes';
var filename = walletName + '-' + timestamp + '-keybackup.json.aes';
var blob = new Blob([ew], {
type: 'text/plain;charset=utf-8'
});