diff --git a/css/src/main.css b/css/src/main.css index ca693ca11..a0957a77f 100644 --- a/css/src/main.css +++ b/css/src/main.css @@ -909,6 +909,14 @@ label small.has-error { font-size: 11px; } +table tr.active { + background: #CBECE6; +} + +table tr.deleting { + background: #FCD5D5; +} + /* SECONDARY */ input[type='submit'] diff --git a/css/src/mobile.css b/css/src/mobile.css index 400c76249..e7e42fe1f 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -6,17 +6,6 @@ @media (max-width: 1024px) { - .line-dashed-setup-v, - .line-dashed-v, - .line-dashed-h { - border: none; - } - - .status { - left: 0; - top: 40px; - } - .logo-setup { margin: 20px 0; padding: 2rem 0; diff --git a/js/controllers/manage.js b/js/controllers/manage.js index 97c53a0bc..347d07900 100644 --- a/js/controllers/manage.js +++ b/js/controllers/manage.js @@ -12,4 +12,25 @@ angular.module('copayApp.controllers').controller('ManageController', function($ $scope.backupPlainText = backupService.profileEncrypted($rootScope.iden); $scope.hideViewBackup = true; }; + + $scope.getWallets = function() { + $scope.wallets = []; + var wids = _.pluck($rootScope.iden.listWallets(), 'id'); + _.each(wids, function(wid) { + var w = $rootScope.iden.getWalletById(wid); + $scope.wallets.push(w); + controllerUtils.updateBalance(w, function() { + $rootScope.$digest(); + }, true); + }); + }; + + $scope.deleteWallet = function(w) { + if (!w) return; + $scope.loading = w.id; + controllerUtils.deleteWallet($scope, w, function() { + $scope.loading = false; + $scope.getWallets(); + }); + }; }); diff --git a/js/controllers/more.js b/js/controllers/more.js index 5af6313a9..f1e129e4a 100644 --- a/js/controllers/more.js +++ b/js/controllers/more.js @@ -88,7 +88,13 @@ angular.module('copayApp.controllers').controller('MoreController', }; $scope.deleteWallet = function() { - controllerUtils.deleteWallet($scope); + $scope.loading = true; + controllerUtils.deleteWallet($scope, $rootScope.wallet, function() { + $rootScope.wallet = null; + var lastFocused = $rootScope.iden.getLastFocusedWallet(); + controllerUtils.bindProfile($scope, $rootScope.iden, lastFocused); + $scope.loading = false; + }); }; $scope.purge = function(deleteAll) { diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 9663a291e..a7e374371 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -359,13 +359,12 @@ angular.module('copayApp.services') $rootScope.pendingTxCount = res.pendingForUs; }; - root.deleteWallet = function($scope, w) { - w = w || $rootScope.wallet; + root.deleteWallet = function($scope, w, cb) { + if (!w) return root.onErrorDigest(); + var name = w.getName(); $rootScope.iden.deleteWallet(w.id, function() { - notification.info('Wallet deleted', $filter('translate')('Wallet deleted')); - $rootScope.wallet = null; - var lastFocused = $rootScope.iden.getLastFocusedWallet(); - root.bindProfile($scope, $rootScope.iden, lastFocused); + notification.info(name + ' deleted', $filter('translate')('This wallet was deleted')); + return cb(); }); }; diff --git a/views/includes/sidebar.html b/views/includes/sidebar.html index fa7961da0..2b1d78c37 100644 --- a/views/includes/sidebar.html +++ b/views/includes/sidebar.html @@ -76,7 +76,7 @@ -