Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1492 from blockchain/v1.35-additions
Browse files Browse the repository at this point in the history
v1.35 additions
  • Loading branch information
plondon authored Apr 20, 2018
2 parents 4e892c2 + ea4d82d commit c22f779
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 31 deletions.
4 changes: 4 additions & 0 deletions app/partials/sfox/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion app/templates/exchange/confirm.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions assets/js/controllers/sfox/sfoxCheckout.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
28 changes: 1 addition & 27 deletions assets/js/controllers/wallet.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,38 +104,12 @@ 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 {
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)
Expand Down
4 changes: 2 additions & 2 deletions assets/js/services/wallet.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion locales/en-human.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href='https://www.sfox.com/terms.html' target='_blank' rel='noopener noreferrer'>terms and conditions</a>."
"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 <a href='https://www.sfox.com/terms.html' target='_blank' rel='noopener noreferrer'>Terms of Service</a>, and are in accordance with US law and standard banking (including ACH) guidelines"
},
"processing": {
"DISPLAY": "Pending Sell",
Expand Down

0 comments on commit c22f779

Please sign in to comment.