Update: Adds amount received on payment received overlay on Receive tab

This commit is contained in:
Sam Cheng Hung 2018-03-29 14:14:43 +09:00
commit 124684b5a1
4 changed files with 32 additions and 3 deletions

View file

@ -40,6 +40,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
if ($scope.wallet.coin == 'bch') {
bchAddresses = bitcoinCashJsService.translateAddresses(addr);
$scope.addr = bchAddresses[$scope.bchAddressType.type];
$scope.addrBchLegacy = bchAddresses['legacy'];
// listen to bch address
currentAddressSocket = new WebSocket("wss://ws.blockchain.info/bch/inv");
@ -118,6 +119,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
}*/
if (data.op == "utx") {
var watchAddress = $scope.wallet.coin == 'bch' ? $scope.addrBchLegacy : $scope.addr;
for (var i = 0; i < data.x.out.length; i++) {
if (data.x.out[i].addr == watchAddress) {
$scope.paymentReceivedAmount = (data.x.out[i].value / 100000000).toFixed(8);
}
}
$scope.paymentReceivedCoin = $scope.wallet.coin;
$scope.showingPaymentReceived = true
$scope.$apply();
}

View file

@ -83,4 +83,15 @@
bottom: 0;
width: 100%;
}
.payment-received-container {
margin: 0 20px;
.payment-received-amount {
font-size: 1.8em;
display: block;
margin: 20px auto;
}
.payment-received-currency {
text-transform: uppercase;
}
}
}