diff --git a/app/partials/sfox/checkout.pug b/app/partials/sfox/checkout.pug index 9e479f7c35..b6e228ca16 100644 --- a/app/partials/sfox/checkout.pug +++ b/app/partials/sfox/checkout.pug @@ -58,7 +58,7 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select trade-account="checkout.state.account" handle-quote="sellQuoteHandler(amount, baseCurr, quoteCurr)" on-success="selling().verificationRequired ? checkout.openSfoxSignup() : buildPayment(quote)") - .flex-column.width-50.pl-30.prn.pv-10-mobile.no-margin-mobile.hidden-xs(ng-if="checkout.onStep('create') && !checkout.hasDismissedSellIntro()") + .flex-column.width-50.pl-30.prn.pv-10-mobile.no-margin-mobile.hidden-xs(ng-if="checkout.onStep('create') && !checkout.hasDismissedSellIntro() && !pendingSellTrades().length") .flex-between span.f-24.blue.f-14-mobile i.icon-buy-sell.h3.mrm @@ -66,6 +66,10 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select span i.pointer.ti-close.f-14.mid-grey(ng-click="checkout.dismissSellIntro()") p.f-12.mt-10(translate="SFOX.sell.INTRODUCING_BODY") + .width-50.pl-30.prn.pv-10-mobile.no-margin-mobile(ng-if="pendingSellTrades().length") + span You have {{ pendingSellTrades().length }} pending sell {{ pendingSellTrades().length === 1 ? 'transaction' : 'transactions' }} for a total of {{ pendingSellTradesTotal() }} USD. You can see more details in your + |   + a(ng-click="tabs.select('ORDER_HISTORY')") Order History. .flex-row.pbvl(ng-if="checkout.onStep('confirm')") exchange-confirm.width-55.border-desktop( type="checkout.type" diff --git a/assets/js/controllers/sfox/sfoxCheckout.controller.js b/assets/js/controllers/sfox/sfoxCheckout.controller.js index 31dc64aad8..55ead8e581 100644 --- a/assets/js/controllers/sfox/sfoxCheckout.controller.js +++ b/assets/js/controllers/sfox/sfoxCheckout.controller.js @@ -10,7 +10,9 @@ function SfoxCheckoutController ($scope, $timeout, $stateParams, $q, Wallet, MyW $scope.showBuy = () => MyWallet.wallet.accountInfo.invited.sfoxBuy; $scope.pendingBuyTrades = () => $scope.pendingTrades().filter((t) => t.isBuy); + $scope.pendingSellTrades = () => $scope.pendingTrades().filter((t) => !t.isBuy); $scope.pendingBuyTradesTotal = () => $scope.pendingBuyTrades().map((t) => t.receiveAmount).reduce((acc, amt) => acc + amt); + $scope.pendingSellTradesTotal = () => $scope.pendingSellTrades().map((t) => t.receiveAmount).reduce((acc, amt) => acc + amt).toFixed(2); this.handleCancel = (skipConfirm, type, step) => { if (skipConfirm) $scope.checkout.goTo('create');