intermediate screen backup

This commit is contained in:
Manuel Araoz 2014-06-25 17:14:12 -03:00
commit 1639b796cf
6 changed files with 58 additions and 20 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('HeaderController',
function($scope, $rootScope, $location, notification, $http, controllerUtils) {
function($scope, $rootScope, $location, notification, $http, controllerUtils, backupService) {
$scope.menu = [{
'title': 'Addresses',
'icon': 'fi-address-book',
@ -135,4 +135,11 @@ angular.module('copayApp.controllers').controller('HeaderController',
$scope.$on('$destroy', function() {
window.onbeforeunload = undefined;
});
$scope.backupAndOpen = function() {
var w = $rootScope.wallet;
backupService.download(w);
w.offerBackup();
};
});

View file

@ -33,7 +33,7 @@ var valid_pairs = {
};
angular.module('copayApp.controllers').controller('SetupController',
function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase, backupService) {
function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase) {
$rootScope.videoInfo = {};
$scope.loading = false;
@ -84,7 +84,6 @@ 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, backupService) {
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
var cmp = function(o1, o2) {
var v1 = o1.show.toLowerCase(),
v2 = o2.show.toLowerCase();
@ -89,7 +89,6 @@ angular.module('copayApp.controllers').controller('SigninController',
};
controllerUtils.onErrorDigest();
} else {
backupService.download(w);
controllerUtils.startNetwork(w, $scope);
}
});