From f27326460069349e02baed5f2da14ec34c4fce5e Mon Sep 17 00:00:00 2001 From: plondon Date: Sat, 2 Dec 2017 12:32:45 -0500 Subject: [PATCH] fix(BCH): set payment to to bch address --- app/partials/send/send-bitcoin-cash.pug | 5 +---- app/partials/send/send-confirm.pug | 1 + assets/js/components/send-confirm.component.js | 1 + assets/js/controllers/send/sendBitcoinCash.controller.js | 6 +++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/partials/send/send-bitcoin-cash.pug b/app/partials/send/send-bitcoin-cash.pug index 8b23c985c2..a87f9cc1a1 100644 --- a/app/partials/send/send-bitcoin-cash.pug +++ b/app/partials/send/send-bitcoin-cash.pug @@ -53,10 +53,7 @@ accounts="origins" ng-model="transaction.destination" ng-model-options="{ updateOn: 'blur' }" - ng-change="checkForSameDestination()" ng-paste="handlePaste($event)" - on-payment-request="applyPaymentRequest(request)" - set-input-metric="$parent.inputMetric = metric" ignore="transaction.from" required) .has-error @@ -118,4 +115,4 @@ .group.mt-25 button.button-primary(translate="CONTINUE" ng-click="goTo('send-confirm')" ng-disabled="sendForm.$invalid || transaction.amount > transaction.maxAvailable") .flex-column.width-100(ng-if="onStep('send-confirm')") - send-confirm(tx="transaction" on-send="send()" asset="'bch'" on-go-back="goTo('send-cash')") + send-confirm(tx="transaction" on-send="send()" asset="'bch'" on-go-back="goTo('send-cash')" locked="locked") diff --git a/app/partials/send/send-confirm.pug b/app/partials/send/send-confirm.pug index 174f1a0d0f..c65ea8bd7f 100644 --- a/app/partials/send/send-confirm.pug +++ b/app/partials/send/send-confirm.pug @@ -36,6 +36,7 @@ ladda-translate="{{$ctrl.getButtonContent()}}" ui-ladda="sending" ng-click="$ctrl.onSend()" + ng-disabled="$ctrl.locked" data-style="expand-left") div.width-100.center.mt-10 a.f-14(ng-click="$ctrl.onGoBack()" translate="GO_BACK") diff --git a/assets/js/components/send-confirm.component.js b/assets/js/components/send-confirm.component.js index a63f03cede..6ea3fbfda3 100644 --- a/assets/js/components/send-confirm.component.js +++ b/assets/js/components/send-confirm.component.js @@ -4,6 +4,7 @@ angular bindings: { tx: '<', asset: '<', + locked: '<', onSend: '&', onGoBack: '&' }, diff --git a/assets/js/controllers/send/sendBitcoinCash.controller.js b/assets/js/controllers/send/sendBitcoinCash.controller.js index ba471850df..189ef87213 100644 --- a/assets/js/controllers/send/sendBitcoinCash.controller.js +++ b/assets/js/controllers/send/sendBitcoinCash.controller.js @@ -45,12 +45,16 @@ function SendBitcoinCashController ($rootScope, $scope, AngularHelper, Env, MyWa }; $scope.send = () => { + let addr; let tx = $scope.transaction; let payment = $scope.transaction.from.createPayment(); + if (!tx.destination.label) addr = tx.destination.address; + else addr = MyWallet.wallet.bch.accounts[tx.destination.index].receiveAddress; + $scope.lock(); - payment.to(tx.destination); + payment.to(addr); payment.amount(tx.amount); payment.feePerByte(feePerByte); payment.build();