diff --git a/src/js/controllers/customAmount.js b/src/js/controllers/customAmount.js index 4d31f5ea6..a58f9767b 100644 --- a/src/js/controllers/customAmount.js +++ b/src/js/controllers/customAmount.js @@ -8,6 +8,10 @@ angular.module('copayApp.controllers').controller('customAmountController', func }); }; + var setProtocolHandler = function() { + $scope.protocolHandler = walletService.getProtocolHandler($scope.wallet); + } + $scope.$on("$ionicView.beforeEnter", function(event, data) { var walletId = data.stateParams.id; @@ -20,6 +24,8 @@ angular.module('copayApp.controllers').controller('customAmountController', func $scope.wallet = profileService.getWallet(walletId); + setProtocolHandler(); + walletService.getAddress($scope.wallet, false, function(err, addr) { if (!addr) { showErrorAndBack('Error', 'Could not get the address'); diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 97303c4ff..6677aa26d 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -124,8 +124,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi return wallet; } + var setProtocolHandler = function() { + $scope.protocolHandler = walletService.getProtocolHandler($scope.wallet); + } + $scope.onWalletSelect = function(wallet) { $scope.wallet = wallet; + setProtocolHandler(); $scope.setAddress(); }; diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index 1e7eb6dc8..3768cecaa 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -1232,5 +1232,10 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim }); }; + root.getProtocolHandler = function(wallet) { + if (wallet.coin== 'bch') return 'bitcoincash'; + else return 'bitcoin'; + } + return root; }); diff --git a/www/views/customAmount.html b/www/views/customAmount.html index 1c8bf647f..cd3d9da15 100644 --- a/www/views/customAmount.html +++ b/www/views/customAmount.html @@ -21,7 +21,7 @@
- +
diff --git a/www/views/tab-receive.html b/www/views/tab-receive.html index 1e0b203e4..5074da2c0 100644 --- a/www/views/tab-receive.html +++ b/www/views/tab-receive.html @@ -34,7 +34,7 @@ Show address - +
{{addr}}