From f496383ecb6c0b378931be083f337f0403552804 Mon Sep 17 00:00:00 2001 From: Kadir Sekha Date: Wed, 7 Feb 2018 15:46:21 -0400 Subject: [PATCH] display new bitcoin cash address type in payment proposal window --- src/js/controllers/modals/txpDetails.js | 14 +++++++++++++- www/views/modals/txp-details.html | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index 281dc3f07..1c45eaf56 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, $log, ongoingProcess, platformInfo, $ionicScrollDelegate, txFormatService, bwcError, gettextCatalog, lodash, walletService, popupService, $ionicHistory, feeService) { +angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, $log, ongoingProcess, platformInfo, $ionicScrollDelegate, txFormatService, bwcError, gettextCatalog, lodash, walletService, popupService, $ionicHistory, feeService, bitcoinCashJsService) { var isGlidera = $scope.isGlidera; var GLIDERA_LOCK_TIME = 6 * 60 * 60; var now = Math.floor(Date.now() / 1000); @@ -20,8 +20,20 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi initActionList(); checkPaypro(); applyButtonText(); + + $scope.addressDisplayType = 'legacy'; + $scope.toAddresses = { 'legacy': $scope.tx.toAddress } + if ($scope.tx.coin == 'bch') { + var cashAddr = bitcoinCashJsService.translateAddresses($scope.tx.toAddress).cashaddr; + $scope.toAddresses['cashAddr'] = cashAddr; + $scope.addressDisplayType = 'cashAddr'; + } }; + $scope.changeAddressDisplayType = function(type) { + $scope.addressDisplayType = type; + } + function displayFeeValues() { txFormatService.formatAlternativeStr($scope.wallet.coin, $scope.tx.fee, function(v) { $scope.tx.feeFiatStr = v; diff --git a/www/views/modals/txp-details.html b/www/views/modals/txp-details.html index 57ce35df0..2586e3f9b 100644 --- a/www/views/modals/txp-details.html +++ b/www/views/modals/txp-details.html @@ -51,11 +51,22 @@
To - + - + Multiple recipients + + + + Multiple recipients + + +