Merge pull request #1062 from cmgustavo/feature/01-delete

Add delete wallet from the intermediate screen
This commit is contained in:
Matias Alejo Garcia 2014-08-06 18:38:23 -03:00
commit 0ca9bbe86b
4 changed files with 17 additions and 4 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('CopayersController',
function($scope, $rootScope, $location, backupService) {
function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils) {
$scope.backup = function() {
var w = $rootScope.wallet;
@ -18,4 +18,12 @@ angular.module('copayApp.controllers').controller('CopayersController',
$location.path('/addresses');
};
$scope.deleteWallet = function() {
var w = $rootScope.wallet;
w.disconnect();
walletFactory.delete(w.id, function() {
controllerUtils.logout();
});
};
});

View file

@ -6,5 +6,5 @@ angular.module('copayApp.controllers').controller('HomeController',
if ($rootScope.pendingPayment) {
notification.info('Login Required', 'Please open wallet to complete payment');
}
$scope.hasWallets = walletFactory.getWallets().length > 0 ? true : false;
$scope.hasWallets = (walletFactory.getWallets() && walletFactory.getWallets().length > 0) ? true : false;
});