Show pasted address instead of always cashaddr format on bch
This commit is contained in:
parent
448679d1a6
commit
99d8de02da
6 changed files with 19 additions and 9 deletions
|
|
@ -456,6 +456,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
|||
|
||||
var confirmData = {
|
||||
amount: useSendMax ? undefined : satoshis,
|
||||
displayAddress: passthroughParams.displayAddress,
|
||||
fromWalletId: passthroughParams.fromWalletId,
|
||||
sendMax: useSendMax,
|
||||
toAddress: passthroughParams.toAddress,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
|||
kind: '', // 'address', 'contact', 'wallet'
|
||||
name: ''
|
||||
};
|
||||
vm.displayAddress = '';
|
||||
vm.feeCrypto = '';
|
||||
vm.feeFiat = '';
|
||||
vm.fiatCurrency = '';
|
||||
|
|
@ -56,10 +57,9 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
|||
|
||||
var sendFlowData;
|
||||
var config = null;
|
||||
var countDown = null;
|
||||
var defaults = {};
|
||||
var coin = '';
|
||||
var countDown = null;
|
||||
var defaults = {};
|
||||
var usingCustomFee = false;
|
||||
var usingMerchantFee = false;
|
||||
var destinationWalletId = '';
|
||||
|
|
@ -85,7 +85,8 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
|||
satoshis = parseInt(sendFlowData.amount, 10);
|
||||
toAddress = sendFlowData.toAddress;
|
||||
destinationWalletId = sendFlowData.toWalletId;
|
||||
|
||||
|
||||
vm.displayAddress = sendFlowData.displayAddress;
|
||||
vm.originWallet = profileService.getWallet(originWalletId);
|
||||
vm.origin.currency = vm.originWallet.coin.toUpperCase();
|
||||
coin = vm.originWallet.coin;
|
||||
|
|
@ -104,7 +105,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
|||
priceDisplayIsFiat = config.wallet.settings.priceDisplay === 'fiat';
|
||||
vm.origin.currencyColor = (vm.originWallet.coin === 'btc' ? defaults.bitcoinWalletColor : defaults.bitcoinCashWalletColor);
|
||||
console.log("coin", vm.originWallet.coin, vm.origin.currencyColor, config.bitcoinWalletColor, vm.originWallet.coin === 'btc');
|
||||
unitFromSat = 1 / config.wallet.settings.unitToSatoshi;
|
||||
unitFromSat = 1 / config.wallet.settings.unitToSatoshi;
|
||||
}
|
||||
updateSendAmounts();
|
||||
getOriginWalletBalance(vm.originWallet);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
|||
root.redir = function(data, serviceId, serviceData) {
|
||||
var originalAddress = null;
|
||||
var noPrefixInAddress = 0;
|
||||
|
||||
|
||||
if (data.toLowerCase().indexOf('bitcoin') < 0) {
|
||||
noPrefixInAddress = 1;
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
|||
// Timeout is required to enable the "Back" button
|
||||
$timeout(function() {
|
||||
var params = sendFlowService.getStateClone();
|
||||
|
||||
|
||||
if (amount) {
|
||||
params.amount = amount;
|
||||
}
|
||||
|
|
@ -390,6 +390,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
|||
$timeout(function() {
|
||||
var stateParams = {
|
||||
toAddress: toAddress,
|
||||
displayAddress: toAddress,
|
||||
coin: coin,
|
||||
noPrefix: 1
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ angular
|
|||
// even other properties added that this service does not know about. (such as "coin")
|
||||
state: {
|
||||
amount: '',
|
||||
displayAddress: null,
|
||||
fromWalletId: '',
|
||||
sendMax: false,
|
||||
thirdParty: null,
|
||||
|
|
@ -42,6 +43,7 @@ angular
|
|||
console.log("sendFlow clearCurrent()");
|
||||
service.state = {
|
||||
amount: '',
|
||||
displayAddress: null,
|
||||
fromWalletId: '',
|
||||
sendMax: false,
|
||||
thirdParty: null,
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
text-overflow: ellipsis;
|
||||
|
||||
&.expanded {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
text-overflow: clip;
|
||||
}
|
||||
|
||||
.prefix {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,12 @@
|
|||
</div>
|
||||
<div class="item-content item-content-compact" ng-init="addressExpanded = false" ng-if="vm.destination.kind === 'address' && !vm.thirdParty">
|
||||
<div class="address-frame" ng-class="{ 'expanded': addressExpanded }" ng-click="addressExpanded = !addressExpanded">
|
||||
<span class="prefix">{{vm.destination.address.substring(0,5)}}</span><span class="mid">{{vm.destination.address.substring(5,vm.destination.address.length-4)}}</span><span class="suffix">{{vm.destination.address.substring(vm.destination.address.length-4)}}</span>
|
||||
<span ng-if="!vm.displayAddress">
|
||||
<span class="prefix">{{vm.destination.address.substring(0,5)}}</span><span class="mid">{{vm.destination.address.substring(5,vm.destination.address.length-4)}}</span><span class="suffix">{{vm.destination.address.substring(vm.destination.address.length-4)}}</span>
|
||||
</span>
|
||||
<span ng-if="vm.displayAddress">
|
||||
<span class="prefix">{{vm.displayAddress.substring(0,5)}}</span><span class="mid">{{vm.displayAddress.substring(5,vm.displayAddress.length-4)}}</span><span class="suffix">{{vm.displayAddress.substring(vm.displayAddress.length-4)}}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue