Merge pull request #1062 from cmgustavo/feature/01-delete
Add delete wallet from the intermediate screen
This commit is contained in:
commit
0ca9bbe86b
4 changed files with 17 additions and 4 deletions
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue