From 38afc90a9e1d75f097afc2d7630b0933823fbae3 Mon Sep 17 00:00:00 2001 From: plondon Date: Thu, 19 Apr 2018 11:23:03 -0400 Subject: [PATCH 1/5] chore(BuySell): handle disabling partners separately --- assets/js/controllers/wallet.controller.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/assets/js/controllers/wallet.controller.js b/assets/js/controllers/wallet.controller.js index e4a3610607..8f3b5cdc04 100644 --- a/assets/js/controllers/wallet.controller.js +++ b/assets/js/controllers/wallet.controller.js @@ -131,11 +131,7 @@ function WalletCtrl ($scope, $rootScope, Wallet, $uibModal, $timeout, Alerts, $i } else { switch (toState.name) { case 'wallet.common.buy-sell': return ( - featureDisabledWhen($scope.buySellDisabled, $scope.buySellDisabledReason) || - ensureMetadataReady() || - featureDisabledWhen(wallet.external.coinify.user && coinify.disabled, coinify.disabledReason) || - featureDisabledWhen(wallet.external.unocoin.user && unocoin.disabled, unocoin.disabledReason) || - featureDisabledWhen(wallet.external.sfox.user && sfox.disabled, sfox.disabledReason) + featureDisabledWhen($scope.buySellDisabled, $scope.buySellDisabledReason) ); case 'wallet.common.buy-sell.coinify': return ( featureDisabledWhen(coinify.disabled, coinify.disabledReason) From e9645bf5ffbe291dfd640fa69295801b37aff1cb Mon Sep 17 00:00:00 2001 From: plondon Date: Thu, 19 Apr 2018 11:29:01 -0400 Subject: [PATCH 2/5] feat(Watch Only): only show spendable balance --- assets/js/services/wallet.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/services/wallet.service.js b/assets/js/services/wallet.service.js index 6ce47b492e..957cf91374 100644 --- a/assets/js/services/wallet.service.js +++ b/assets/js/services/wallet.service.js @@ -803,9 +803,9 @@ function Wallet ($http, $window, $timeout, $location, $injector, Alerts, MyWalle case void 0: if (wallet.my.wallet.isUpgradedToHD) { if (wallet.my.wallet.balanceActiveLegacy == null || wallet.my.wallet.hdwallet.balanceActiveAccounts == null) return null; - return wallet.my.wallet.hdwallet.balanceActiveAccounts + wallet.my.wallet.balanceActiveLegacy; + return wallet.my.wallet.hdwallet.balanceActiveAccounts + wallet.my.wallet.balanceSpendableActiveLegacy; } else { - return wallet.my.wallet.balanceActiveLegacy; + return wallet.my.wallet.balanceSpendableActiveLegacy; } case 'imported': return wallet.my.wallet.balanceActiveLegacy; From 62635414e5b78be8f1b43261f9dad85250a9eba4 Mon Sep 17 00:00:00 2001 From: plondon Date: Thu, 19 Apr 2018 14:23:43 -0400 Subject: [PATCH 3/5] chore(SFOX): show pending buy amts --- app/partials/sfox/checkout.pug | 4 ++++ assets/js/controllers/sfox/sfoxCheckout.controller.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/partials/sfox/checkout.pug b/app/partials/sfox/checkout.pug index 98c4380ff1..5489c9d258 100644 --- a/app/partials/sfox/checkout.pug +++ b/app/partials/sfox/checkout.pug @@ -40,6 +40,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.dismissBuyIntro()") p.f-12.mt-10(translate="SFOX.buy.INTRODUCING_BODY") + .width-50.pl-30.prn.pv-10-mobile.no-margin-mobile(ng-if="pendingBuyTrades().length") + span You have {{ pendingBuyTrades().length }} pending buy {{ pendingBuyTrades().length === 1 ? 'transaction' : 'transactions' }} for a total of {{ pendingBuyTradesTotal() }} BTC. You can see more details in your + |   + a(ng-click="tabs.select('ORDER_HISTORY')") Order History. .flex-row.pbvl(ng-show="tabs.selectedTab === 'SELL_BITCOIN' && checkout.onStep('create')") .border-desktop.ph-30.pv-30.width-50.no-padding-mobile(ng-controller="SfoxSellCheckoutController") exchange-checkout( diff --git a/assets/js/controllers/sfox/sfoxCheckout.controller.js b/assets/js/controllers/sfox/sfoxCheckout.controller.js index 033e32a0d4..31dc64aad8 100644 --- a/assets/js/controllers/sfox/sfoxCheckout.controller.js +++ b/assets/js/controllers/sfox/sfoxCheckout.controller.js @@ -9,6 +9,8 @@ function SfoxCheckoutController ($scope, $timeout, $stateParams, $q, Wallet, MyW let buyLinks = env.partners.sfox.buySurveyLinks; $scope.showBuy = () => MyWallet.wallet.accountInfo.invited.sfoxBuy; + $scope.pendingBuyTrades = () => $scope.pendingTrades().filter((t) => t.isBuy); + $scope.pendingBuyTradesTotal = () => $scope.pendingBuyTrades().map((t) => t.receiveAmount).reduce((acc, amt) => acc + amt); this.handleCancel = (skipConfirm, type, step) => { if (skipConfirm) $scope.checkout.goTo('create'); From 25c0911e8e400d00089b677b72c7cbc689ca1590 Mon Sep 17 00:00:00 2001 From: plondon Date: Thu, 19 Apr 2018 14:26:56 -0400 Subject: [PATCH 4/5] fix(Linter): remove ensureMetadataReady --- assets/js/controllers/wallet.controller.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/assets/js/controllers/wallet.controller.js b/assets/js/controllers/wallet.controller.js index 8f3b5cdc04..d18e19f791 100644 --- a/assets/js/controllers/wallet.controller.js +++ b/assets/js/controllers/wallet.controller.js @@ -104,28 +104,6 @@ function WalletCtrl ($scope, $rootScope, Wallet, $uibModal, $timeout, Alerts, $i } }; - let ensureMetadataReady = () => { - if (!wallet.isMetadataReady) { - Wallet.askForSecondPasswordIfNeeded() - .then(pw => Wallet.my.wallet.cacheMetadataKey(pw)) - .then(() => { - Alerts.displaySuccess('NEEDS_REFRESH'); - $rootScope.needsRefresh = true; - }); - event.preventDefault(); - return true; - } else if ($rootScope.needsRefresh) { - Alerts.displayError('NEEDS_REFRESH'); - event.preventDefault(); - return true; - } else if (wallet.external === null) { - // Metadata service connection failed - Alerts.displayError('POOR_CONNECTION'); - event.preventDefault(); - return true; - } - }; - if (Wallet.status.isLoggedIn && $scope.isPublicState(toState.name)) { event.preventDefault(); } else { From ea4d82de7a468f8a162ee483f046983f77f0205c Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 19 Apr 2018 14:59:26 -0400 Subject: [PATCH 5/5] fix(Confirm): terms fix --- app/templates/exchange/confirm.pug | 3 ++- locales/en-human.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/templates/exchange/confirm.pug b/app/templates/exchange/confirm.pug index a097567f5d..20eb3705de 100644 --- a/app/templates/exchange/confirm.pug +++ b/app/templates/exchange/confirm.pug @@ -29,7 +29,8 @@ form.bc-form.pv-20( .pts input(type="checkbox" id="terms" name="terms" ng-model="terms" required) label.mbn.f-13.em-300(ng-if="!$ctrl.tradeAccount" for="terms" translate=".ACCEPT_TERMS") - label.mt-15.mb-20.ml-5.f-11.em-300(ng-if="$ctrl.tradeAccount" for="terms" translate=".ACCEPT_TERMS_EXTENDED" translate-values="{account: $ctrl.tradeAccount.accountNumber}") + label.mt-15.mb-20.ml-5.f-11.em-300(ng-if="$ctrl.tradeAccount && type === '.buy'" for="terms" translate=".ACCEPT_TERMS_EXTENDED" translate-values="{account: $ctrl.tradeAccount.accountNumber}") + label.mt-15.mb-20.ml-5.f-11.em-300(ng-if="$ctrl.tradeAccount && type === '.sell'" for="terms" translate=".ACCEPT_TERMS_EXTENDED" translate-values="{account: $ctrl.tradeAccount.accountNumber}") .flex-row.flex-end button.button-muted(type="button" translate="CANCEL" ng-click="$ctrl.onCancel()") button.button-primary.ml-20( diff --git a/locales/en-human.json b/locales/en-human.json index cf3f20fb70..e604373ea5 100644 --- a/locales/en-human.json +++ b/locales/en-human.json @@ -1896,7 +1896,7 @@ "confirm": { "HEADER": "Confirm Sell Order", "BODY": "Please review your trade details below. Click 'Confirm' to initiate.", - "ACCEPT_TERMS": "I agree to SFOX's terms and conditions." + "ACCEPT_TERMS_EXTENDED": "I authorize SFOX, Inc. to credit my linked bank account ending in {{::account}} via ACH and acknowledge that all transactions to/from my bank account comply with the SFOX Terms of Service, and are in accordance with US law and standard banking (including ACH) guidelines" }, "processing": { "DISPLAY": "Pending Sell",