From 64e67aa1382804af142e802d6a07373b8f12a441 Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 08:52:30 -0500 Subject: [PATCH 1/9] fix(SFOX): order history empty state navigates to buy tab --- app/partials/sfox/checkout.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/partials/sfox/checkout.pug b/app/partials/sfox/checkout.pug index 8748c71a0c..634d822f8d 100644 --- a/app/partials/sfox/checkout.pug +++ b/app/partials/sfox/checkout.pug @@ -73,7 +73,7 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select .flex-center.flex-justify i.ti-direction-alt.h3.mrm h3.em-100(translate="NO_TRADES") - p.em-400.pointer(translate="NO_TRADES_EXPLAIN" ng-click="tabs.select('SELL_BITCOIN')") + p.em-400.pointer(translate="NO_TRADES_EXPLAIN" ng-click="tabs.select('BUY_BITCOIN')") div(ng-show="pendingTrades().length") .flex-row.flex-between.flex-center h4.type-h5 Pending Orders From 1158ff0f97c78babc36fa020ebb3beba2b394a85 Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 09:25:22 -0500 Subject: [PATCH 2/9] fix(SFOX): adds note about emailing sfox to change synced account --- app/templates/exchange/checkout.pug | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/templates/exchange/checkout.pug b/app/templates/exchange/checkout.pug index 129a826806..922d52cd6f 100644 --- a/app/templates/exchange/checkout.pug +++ b/app/templates/exchange/checkout.pug @@ -79,6 +79,10 @@ form.bc-form( .flex-column span.capitalize {{ $ctrl.tradeAccount.accountType }} ({{ $ctrl.tradeAccount.accountNumber }}) span.f-12.capitalize Account Holder: {{ $ctrl.tradeAccount.name }} + .flex-row.mt-10 + span.f-12 *To change your Synced Bank Account email + |   + a(href='mailto:support@sfox.com').f-12 support@sfox.com .group.inline.mt-10(ng-if="$ctrl.frequencies && !trading().isDisabled && $ctrl.showRecurringBuy") .item.inline.check input(type="checkbox" id="frequencyCheck" name="frequencyCheck" ng-model="state.frequencyCheck" ng-disabled="checkoutForm.fiat.$viewValue > $ctrl.recurringBuyLimit() || $ctrl.recurringBuyLimit() < min.fiat") From dc3c8cb7f5a84e81b08366851b6ee2d952eead17 Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 10:10:47 -0500 Subject: [PATCH 3/9] feat(SFOX): get buy tx fee from wallet options --- .../sfox/sfoxBuyCheckout.controller.js | 11 ++- .../sfox/sfoxTradeDetails.controller.js | 11 ++- assets/js/services/sfox.service.js | 86 +++++++++++-------- rootApp/Resources/wallet-options.json | 1 + 4 files changed, 65 insertions(+), 44 deletions(-) diff --git a/assets/js/controllers/sfox/sfoxBuyCheckout.controller.js b/assets/js/controllers/sfox/sfoxBuyCheckout.controller.js index 227052f6fe..498b7fe5cf 100644 --- a/assets/js/controllers/sfox/sfoxBuyCheckout.controller.js +++ b/assets/js/controllers/sfox/sfoxBuyCheckout.controller.js @@ -24,10 +24,13 @@ function SfoxBuyCheckoutController ($scope, $timeout, $stateParams, $q, Wallet, $scope.prepareBuy = (quote) => { $scope.checkout.quote = quote; - $scope.checkout.tradeDetails = sfox.buyTradeDetails($scope.checkout.quote); - $scope.checkout.type = 'buy'; - $scope.checkout.goTo('confirm'); - return quote; + return $q.resolve(sfox.buyTradeDetails($scope.checkout.quote)) + .then(details => { + $scope.checkout.tradeDetails = details; + $scope.checkout.type = 'buy'; + $scope.checkout.goTo('confirm'); + return quote; + }); }; $scope.checkout.buyHandler = (quote) => sfox.buy($scope.checkout.state.account, quote) diff --git a/assets/js/controllers/sfox/sfoxTradeDetails.controller.js b/assets/js/controllers/sfox/sfoxTradeDetails.controller.js index 2a41dc46a5..016ef3e519 100644 --- a/assets/js/controllers/sfox/sfoxTradeDetails.controller.js +++ b/assets/js/controllers/sfox/sfoxTradeDetails.controller.js @@ -2,7 +2,7 @@ angular .module('walletApp') .controller('SfoxTradeDetailsController', SfoxTradeDetailsController); -function SfoxTradeDetailsController ($scope, MyWallet, Exchange, currency, sfox) { +function SfoxTradeDetailsController ($scope, MyWallet, Exchange, currency, sfox, $q) { let trade = $scope.$parent.trade || $scope.checkout.trade || $scope.trade; let format = currency.formatCurrencyForView; let fiat = currency.currencies.find((c) => c.code === 'USD'); @@ -16,7 +16,14 @@ function SfoxTradeDetailsController ($scope, MyWallet, Exchange, currency, sfox) $scope.namespace = 'SFOX'; $scope.state = '.' + trade.state; $scope.type = trade.isBuy ? '.buy' : '.sell'; - $scope.tradeDetails = $scope.type === '.buy' ? sfox.buyTradeDetails(null, trade, tx) : sfox.sellTradeDetails(null, null, trade, tx); + + if ($scope.type === '.buy') { + $q.resolve(sfox.buyTradeDetails(null, trade, tx)) + .then(details => $scope.tradeDetails = details); + } else { + $scope.tradeDetails = sfox.sellTradeDetails(null, null, trade, tx); + } + $scope.rate = $scope.type === '.buy' ? format((trade.sendAmount / 1e8) / trade.receiveAmount, fiat, true) : format(1 / (trade.sendAmount / 1e8) * (trade.receiveAmount + trade.feeAmount), fiat, true); diff --git a/assets/js/services/sfox.service.js b/assets/js/services/sfox.service.js index cd97126dee..ba21f2df04 100644 --- a/assets/js/services/sfox.service.js +++ b/assets/js/services/sfox.service.js @@ -211,49 +211,59 @@ function sfox ($q, MyWallet, Alerts, modals, Env, Exchange, currency, localStora } function buyTradeDetails (quote, trade, tx) { - let { formatCurrencyForView, convertFromSatoshi } = currency; - let fiat = currency.currencies.find((curr) => curr.code === 'USD'); - let btc = currency.bitCurrencies.find((curr) => curr.code === 'BTC'); - // let fee = tx ? tx.fee : 16830; // TODO add real fee - let amount = quote - ? quote.baseCurrency === 'USD' ? quote.quoteAmount : quote.baseAmount - : trade.receiveAmount * 1e8; + let buyTxFee; + return Env.then(env => { + buyTxFee = env.partners.sfox.buyTransactionFeeInSatoshi; + let { formatCurrencyForView, convertFromSatoshi } = currency; + let fiat = currency.currencies.find((curr) => curr.code === 'USD'); + let btc = currency.bitCurrencies.find((curr) => curr.code === 'BTC'); + let fee = buyTxFee; + let amount = quote + ? quote.baseCurrency === 'USD' ? quote.quoteAmount : quote.baseAmount + : trade.receiveAmount * 1e8; - let fiatAmount = quote - ? quote.baseCurrency === 'USD' ? quote.baseAmount : quote.quoteAmount - : trade.inAmount / 1e8; + let fiatAmount = quote + ? quote.baseCurrency === 'USD' ? quote.baseAmount : quote.quoteAmount + : trade.inAmount / 1e8; - let tradingFee = quote ? parseFloat(quote.feeAmount) : parseFloat(trade.feeAmount); - // let totalAmount = tx ? Math.abs(tx.amount) : amount - fee; + let tradingFee = quote ? parseFloat(quote.feeAmount) : parseFloat(trade.feeAmount); - let toBeSpent = quote - ? quote.baseCurrency === 'BTC' ? (+quote.quoteAmount + +tradingFee) : (+quote.baseAmount + +tradingFee) - : (trade.inAmount / 1e8 + trade.feeAmount); - let amountKey = quote ? '.AMT' : '.AMT_BOUGHT'; + let toBeSpent = quote + ? quote.baseCurrency === 'BTC' ? (+quote.quoteAmount + +tradingFee) : (+quote.baseAmount + +tradingFee) + : (trade.inAmount / 1e8 + trade.feeAmount); + let amountKey = quote ? '.AMT' : '.AMT_BOUGHT'; - return { - txAmt: { - key: amountKey, - val: `${formatCurrencyForView(convertFromSatoshi(amount, btc), btc, true)} ($${fiatAmount})` - }, - // txFee: { - // key: '.TX_FEE', - // val: formatCurrencyForView(convertFromSatoshi(fee, btc), btc, true) - // }, - // out: { - // key: '.TOTAL', - // val: formatCurrencyForView(convertFromSatoshi(totalAmount, btc), btc, true) - // }, - sfoxFee: { - key: '.TRADING_FEE', - val: formatCurrencyForView(tradingFee.toFixed(2), fiat, true) - }, - in: { - key: '.TO_BE_SPENT', - val: formatCurrencyForView(toBeSpent.toFixed(2), fiat, true), - tip: () => console.log('Clicked tooltip') + let details = { + txAmt: { + key: amountKey, + val: `${formatCurrencyForView(convertFromSatoshi(amount, btc), btc, true)} ($${fiatAmount})` + }, + sfoxFee: { + key: '.TRADING_FEE', + val: formatCurrencyForView(tradingFee.toFixed(2), fiat, true) + }, + in: { + key: '.TO_BE_SPENT', + val: formatCurrencyForView(toBeSpent.toFixed(2), fiat, true), + tip: () => console.log('Clicked tooltip') + } + }; + + if (buyTxFee) { + let totalAmount = tx ? Math.abs(tx.amount) : amount - fee; + + details.txFee = { + key: '.TX_FEE', + val: formatCurrencyForView(convertFromSatoshi(fee, btc), btc, true) + }; + details.out = { + key: '.TOTAL', + val: formatCurrencyForView(convertFromSatoshi(totalAmount, btc), btc, true) + }; } - }; + + return details; + }); } function getTxMethod (hash) { diff --git a/rootApp/Resources/wallet-options.json b/rootApp/Resources/wallet-options.json index 767c01f33a..275cde1083 100644 --- a/rootApp/Resources/wallet-options.json +++ b/rootApp/Resources/wallet-options.json @@ -43,6 +43,7 @@ "ME", "MI", "MO", "MT", "OH", "NJ", "NY", "PA", "SC", "TN", "TX", "UT", "VA"], "showBuyFraction": 1, "inviteFormFraction": 0.1, + "buyTransactionFeeInSatoshi": false, "apiKey": "6fbfb80536564af8bbedb7e3be4ec439", "plaid": "0b041cd9e9fbf1e7d93a0d5a39f5b9", "plaidEnv": "tartan", From a3d1dcc657f3085fa08c416118bbd2d2056dfffd Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 14:12:35 -0500 Subject: [PATCH 4/9] fix(SFOX): do not use rate from quote --- .../js/components/exchange/exchange-confirm.component.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/js/components/exchange/exchange-confirm.component.js b/assets/js/components/exchange/exchange-confirm.component.js index beaebae0a5..d3408de7fc 100644 --- a/assets/js/components/exchange/exchange-confirm.component.js +++ b/assets/js/components/exchange/exchange-confirm.component.js @@ -25,7 +25,6 @@ function ExchangeConfirmController (Env, AngularHelper, $scope, $rootScope, $tim $scope.tradeState = '.confirm'; $scope.namespace = this.namespace; $scope.bitcoin = currency.bitCurrencies.filter(c => c.code === 'BTC')[0]; - $scope.rate = this.quote.rate; $scope.getTimeToExpiration = () => this.quote.expiresAt - new Date() - 5000; $scope.onExpiration = () => { $scope.lock(); this.quote = null; this.onExpiration().then($scope.free); }; @@ -43,8 +42,12 @@ function ExchangeConfirmController (Env, AngularHelper, $scope, $rootScope, $tim AngularHelper.installLock.call($scope); Env.then(env => $scope.qaDebugger = env.qaDebugger); this.$onChanges = (changes) => { - if (changes.quote.currentValue.rate !== changes.quote.previousValue.rate) { - $scope.rate = changes.quote.currentValue.rate; + let curVal = changes.quote.currentValue; + if (curVal.rate !== changes.quote.previousValue.rate) { + $scope.rate = Number.isInteger(curVal.quoteAmount) + ? parseFloat(curVal.baseAmount) / (curVal.quoteAmount / 1e8) + : parseFloat(curVal.quoteAmount) / (curVal.baseAmount / 1e8); + this.details = changes.details.currentValue; } }; From 44fd82899dcefb284ca908475311215df5107c5c Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 14:33:39 -0500 Subject: [PATCH 5/9] fix(SFOX): change confirmation table copy, show tx fee in fiat --- assets/js/services/sfox.service.js | 3 ++- locales/en-human.json | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/js/services/sfox.service.js b/assets/js/services/sfox.service.js index ba21f2df04..cf5d5be9f2 100644 --- a/assets/js/services/sfox.service.js +++ b/assets/js/services/sfox.service.js @@ -218,6 +218,7 @@ function sfox ($q, MyWallet, Alerts, modals, Env, Exchange, currency, localStora let fiat = currency.currencies.find((curr) => curr.code === 'USD'); let btc = currency.bitCurrencies.find((curr) => curr.code === 'BTC'); let fee = buyTxFee; + let fiatFee = currency.convertFromSatoshi(fee, fiat); let amount = quote ? quote.baseCurrency === 'USD' ? quote.quoteAmount : quote.baseAmount : trade.receiveAmount * 1e8; @@ -254,7 +255,7 @@ function sfox ($q, MyWallet, Alerts, modals, Env, Exchange, currency, localStora details.txFee = { key: '.TX_FEE', - val: formatCurrencyForView(convertFromSatoshi(fee, btc), btc, true) + val: `${formatCurrencyForView(convertFromSatoshi(fee, btc), btc, true)} ($${formatCurrencyForView(fiatFee, fiat, false)})` }; details.out = { key: '.TOTAL', diff --git a/locales/en-human.json b/locales/en-human.json index e3c048b4f0..a0ca8f9a32 100644 --- a/locales/en-human.json +++ b/locales/en-human.json @@ -1953,10 +1953,10 @@ "HEADER": "Buy Order Complete", "BODY": "Your buy trade has successfully completed. Thank you for using Blockchain to trade your bitcoin. Your order ID is: SFX-{{::tradeId}}" }, - "AMT": "Amount", - "AMT_BOUGHT": "Amount Purchased", + "AMT": "BTC Amount To Purchase", + "AMT_BOUGHT": "BTC Amount Purchased", "TOTAL": "Bitcoin Amount to be Received", - "TO_BE_SPENT": "USD Spent", + "TO_BE_SPENT": "Total Cost", "TRADING_FEE": "@:SFOX.sell.TRADING_FEE", "TX_FEE": "@:SFOX.sell.TX_FEE", "COMING_SOON": "We are working hard to bring buy bitcoin functionality to your wallet very soon.", From f04125dcaa2c9c63bc398a0dadff29d1bee54dee Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 15:06:29 -0500 Subject: [PATCH 6/9] fix(Exchange): guard against bad javascript math --- assets/js/components/exchange/exchange-checkout.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/components/exchange/exchange-checkout.component.js b/assets/js/components/exchange/exchange-checkout.component.js index 2500d89511..9c2dd1e5e2 100644 --- a/assets/js/components/exchange/exchange-checkout.component.js +++ b/assets/js/components/exchange/exchange-checkout.component.js @@ -71,7 +71,7 @@ function ExchangeCheckoutController (Env, AngularHelper, $scope, $rootScope, $ti }; $scope.getQuoteArgs = (state) => ({ - amount: state.baseFiat ? state.fiat * this.conversion | 0 : state.btc * 1e8, + amount: state.baseFiat ? state.fiat * this.conversion | 0 : state.btc * 1e8 | 0, baseCurr: state.baseCurr.code, quoteCurr: state.quoteCurr.code }); From ec10528ed2b0a888e011057fe94fb34be0e31b5f Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 15:37:12 -0500 Subject: [PATCH 7/9] fix(SFOX): change copy about split deposits time to process --- app/partials/sfox/link.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/partials/sfox/link.pug b/app/partials/sfox/link.pug index a21261595f..11b27125b3 100644 --- a/app/partials/sfox/link.pug +++ b/app/partials/sfox/link.pug @@ -96,7 +96,7 @@ button.helper(ng-click="openHelper('bank-deposit-helper')" type="button" tabindex="-1") span ? .mbl - span.f-16(translate="To verify your bank account details, SFOX will send two micro-deposits to your account. These deposits will be in the amount of a few cents. Once received, you can return to this screen to enter the amounts.

Please note: Receiving these deposits can take 1-3 business days.") + span.f-16(translate="To verify your bank account details, SFOX will send two micro-deposits to your account. These deposits will be in the amount of a few cents. Once received, you can return to this screen to enter the amounts.

Please note: Receiving these deposits can take up to 4 business days.") .width-65.flex-justify form.bc-form.width-90.width-100-tablet.width-100-mobile(name="verifyBankAccountForm" ng-submit="verify()" novalidate autocomplete="off") fieldset(ng-disabled="locked") From bf07e213ada0ef194dc923fb7e56fc2bc30736aa Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 15:56:27 -0500 Subject: [PATCH 8/9] fix(SFOX): change sell only copy --- app/partials/buy-sell-select-partner.pug | 10 ++++++---- .../js/controllers/buySellSelectPartner.controller.js | 4 ++-- locales/en-human.json | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/partials/buy-sell-select-partner.pug b/app/partials/buy-sell-select-partner.pug index 9969912dd6..622a23ca93 100644 --- a/app/partials/buy-sell-select-partner.pug +++ b/app/partials/buy-sell-select-partner.pug @@ -36,9 +36,11 @@ div .item input(type="email" ng-model="email" required) button.btn.button-primary.full-width.mt-20(translate="EXCHANGE.NOTIFY_ME_WHEN_AVAIL" type="submit") - .ml-30.width-40.hidden-xs(ng-if="!hasDismissedSellIntro() && (country.Code === 'US' || $parent.country.Code === 'US')") + .ml-30.width-40.hidden-xs(ng-if="!hasDismissedBuyIntro() && (country.Code === 'US' || $parent.country.Code === 'US')") .flex-between - span.f-24.blue.f-14-mobile(translate="SFOX.sell.INTRODUCING_HEADER") + span.f-24.blue.f-14-mobile(translate="SFOX.buy.INTRODUCING_HEADER") .flex-center.pl-10 - i.pointer.ti-close.f-12.mid-grey(ng-click="dismissSellIntro()") - p.f-12.mt-10(translate="SFOX.sell.INTRODUCING_BODY") + i.pointer.ti-close.f-12.mid-grey(ng-click="dismissBuyIntro()") + p.f-12.mt-10(translate="SFOX.buy.INTRODUCING_BODY") + + diff --git a/assets/js/controllers/buySellSelectPartner.controller.js b/assets/js/controllers/buySellSelectPartner.controller.js index 33746983fc..37ef5d3f10 100644 --- a/assets/js/controllers/buySellSelectPartner.controller.js +++ b/assets/js/controllers/buySellSelectPartner.controller.js @@ -84,8 +84,8 @@ function BuySellSelectPartnerController ($scope, $state, $timeout, Wallet, MyWal contains(stateCode, $scope.sfoxStateWhitelist) && 'sfox' || false ); - $scope.dismissSellIntro = sfox.dismissSellIntro; - $scope.hasDismissedSellIntro = sfox.hasDismissedSellIntro; + $scope.dismissBuyIntro = sfox.dismissBuyIntro; + $scope.hasDismissedBuyIntro = sfox.hasDismissedBuyIntro; Env.then(env => { let email = MyWallet.wallet.accountInfo.email; diff --git a/locales/en-human.json b/locales/en-human.json index a0ca8f9a32..29d05f07f8 100644 --- a/locales/en-human.json +++ b/locales/en-human.json @@ -1375,7 +1375,7 @@ "BUY_BITCOIN_EXPLAIN": "You can now buy bitcoin with your Blockchain wallet!", "SELL_BITCOIN_EXPLAIN": "You can now sell bitcoin directly from your Blockchain wallet!", "BUY_BTC_UNAVAIL_COUNTRY": "Buying bitcoin is not yet available in your country. We'll be rolling out more countries soon.", - "SELL_BTC_UNAVAIL_STATE": "Unfortunately selling bitcoin is not available in your state at this time. To be notified when we expand to your area, sign up below.", + "SELL_BTC_UNAVAIL_STATE": "Unfortunately trading bitcoin is not available in your state at this time. To be notified when we expand to your area, sign up below.", "NO_TRADES": "Your Order History", "BTC_APPROX_RATE": "BTC (approximate rate):", "BTC_TX_FEE": "BTC Transaction Fee", @@ -1790,7 +1790,7 @@ }, "SFOX": { "EXPLAIN": "Our partner SFOX will process your bitcoin trades. You will need to provide some information and link a payment method.", - "BUY_SIMPLE_STEPS": "Blockchain works with exchange partners to make selling bitcoin in your wallet secure and seamless.", + "BUY_SIMPLE_STEPS": "Blockchain works with exchange partners to make buying & selling bitcoin in your wallet secure and seamless.", "NOW_SUPPORTING": "The Wait is Over!", "ANNOUNCEMENT": "We’re excited to announce that you can now trade bitcoin directly from your Blockchain wallet! You can get started by creating an account in your 'Buy & Sell Bitcoin' tab.", "GET_STARTED": "Start Trading", @@ -1961,8 +1961,8 @@ "TX_FEE": "@:SFOX.sell.TX_FEE", "COMING_SOON": "We are working hard to bring buy bitcoin functionality to your wallet very soon.", "TRANSACTION_FEE_HELPER": "This fee is used to send the bitcoin from SFOX to your wallet.", - "INTRODUCING_HEADER": "Introducing Buy", - "INTRODUCING_BODY": "We’ve partnered with SFOX so you can buy bitcoin.

You can now buy bitcoin directly from your wallet by linking your bank account - it's simple, seamless, and secure." + "INTRODUCING_HEADER": "Introducing Buy!", + "INTRODUCING_BODY": "We’ve partnered with SFOX so you can now buy bitcoin 🎉

You can now buy bitcoin directly from your wallet by linking your bank account - it's simple, seamless, and secure." }, "create": "Create Account", "verify": "Verify Identity", From 2ea43c583544ead219f29295ac22bf0dcd24878c Mon Sep 17 00:00:00 2001 From: Philip Welber Date: Thu, 8 Feb 2018 16:19:23 -0500 Subject: [PATCH 9/9] fix(SFOX): show buy login modal to potential sfox users --- assets/js/controllers/wallet.controller.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/controllers/wallet.controller.js b/assets/js/controllers/wallet.controller.js index a2e29c0582..2eab21eae4 100644 --- a/assets/js/controllers/wallet.controller.js +++ b/assets/js/controllers/wallet.controller.js @@ -213,8 +213,7 @@ function WalletCtrl ($scope, $rootScope, Wallet, $uibModal, $timeout, Alerts, $i } if (Wallet.goal.firstTime && Wallet.status.didUpgradeToHd) { tradeStatus.canTrade().then((canTrade) => { - let countryGuess = MyWallet.wallet.accountInfo.countryCodeGuess; - let template = canTrade && !$scope.buySellDisabled && countryGuess !== 'US' ? 'partials/buy-login-modal.pug' : 'partials/first-login-modal.pug'; + let template = canTrade && !$scope.buySellDisabled ? 'partials/buy-login-modal.pug' : 'partials/first-login-modal.pug'; $uibModal.open({ templateUrl: template, windowClass: 'bc-modal rocket-modal initial',