diff --git a/public/views/modals/wallets.html b/public/views/modals/wallets.html index 163d5ec70..8975e5567 100644 --- a/public/views/modals/wallets.html +++ b/public/views/modals/wallets.html @@ -13,18 +13,32 @@
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 635b4f0fa..39e9ce28d 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -237,7 +237,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.copayers = walletStatus.wallet.copayers; self.preferences = walletStatus.preferences; self.setBalance(walletStatus.balance); - self.otherWallets = profileService.getWallets(self.network); + self.otherWallets = lodash.filter(profileService.getWallets(self.network), function(w) { + return w.id != self.walletId; + });; $rootScope.$apply(); }); }); diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index f2e1e29a9..cc6f3e342 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -129,14 +129,32 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi $scope.openWalletsModal = function(wallets) { - var fc = profileService.focusedClient; var ModalInstanceCtrl = function($scope, $modalInstance) { $scope.wallets = wallets; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; + + $scope.selectWallet = function(walletId, walletName) { + $scope.gettingAddress=true; + $scope.selectedWalletName=walletName; + $timeout(function(){ + $scope.$apply(); + }); + addressService.getAddress(walletId,true, function(err,addr) { + $scope.gettingAddress=false; + if (!err || addr) + $modalInstance.close(addr); + else { + parseError(err); + self.error = err; + $modalInstance.dismiss('cancel'); + } + }); + }; }; + var modalInstance = $modal.open({ templateUrl: 'views/modals/wallets.html', windowClass: 'full animated slideInUp', @@ -147,6 +165,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi var m = angular.element(document.getElementsByClassName('reveal-modal')); m.addClass('slideOutDown'); }); + + modalInstance.result.then(function(addr) { + if (addr) { + self.setForm(addr); + } + }); }; this.openTxpModal = function(tx, copayers) {