From 7aecd2306f64188e45be5f4a65a491a08f9f70c1 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 23 Jul 2018 14:48:25 +0200 Subject: [PATCH] comments & show wallets --- src/js/controllers/walletToWalletController.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/walletToWalletController.js b/src/js/controllers/walletToWalletController.js index e12b78837..d83f93ddb 100644 --- a/src/js/controllers/walletToWalletController.js +++ b/src/js/controllers/walletToWalletController.js @@ -3,10 +3,10 @@ angular.module('copayApp.controllers').controller('walletToWalletController', function($scope, $rootScope, $log, configService, gettextCatalog, profileService) { $scope.$on("$ionicView.enter", function(event, data) { - $scope.type = 'origin'; - $scope.coin = 'bch'; + $scope.type = 'origin'; // origin || destination + $scope.coin = false; // Wallets to show (for destination screen) $scope.walletsEmpty = []; - $scope.isPaymentRequest = true; + $scope.isPaymentRequest = true; // Show price-header if ($scope.type === 'origin') { $scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from'); @@ -15,8 +15,12 @@ angular.module('copayApp.controllers').controller('walletToWalletController', fu $scope.headerTitle = gettextCatalog.getString('Choose a wallet to send to'); } - $scope.walletsBch = profileService.getWallets({coin: 'bch', hasFunds: $scope.type==='origin'}); - $scope.walletsBtc = profileService.getWallets({coin: 'btc', hasFunds: $scope.type==='origin'}); + if (!$scope.coin || $scope.coin === 'bch') { + $scope.walletsBch = profileService.getWallets({coin: 'bch', hasFunds: $scope.type==='origin'}); + } + if (!$scope.coin || $scope.coin === 'btc') { + $scope.walletsBtc = profileService.getWallets({coin: 'btc', hasFunds: $scope.type === 'origin'}); + } configService.whenAvailable(function(config) { $scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;