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

Commit

Permalink
feat(Recurring Buy): use new tradeSubscriptionsAllowed flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Apr 9, 2018
1 parent 00bbe4c commit b0037e1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/partials/coinify-modal.pug
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
span(ng-if="vm.trade && vm.trade.sendAmount") ({{ vm.trade.sendAmount / 100 | format }} {{ vm.trade.inCurrency }})
countdown.mid-grey(ng-if="vm.quote && vm.quote.id && vm.medium !== 'bank'" time-to-expiration="vm.timeToExpiration" on-expiration="vm.refreshQuote()" debug="vm.qaDebugger" message="'RATE_GUARANTEED'")
countdown.mid-grey(ng-if="vm.trade && vm.trade.expiresAt && !vm.state.trade.expired && vm.trade.medium !== 'bank'" time-to-expiration="vm.timeToExpiration" on-expiration="vm.expireTrade()" debug="vm.qaDebugger" message="'RATE_GUARANTEED'")
//- coinify-recurring-confirm(ng-if="vm.onStep('confirmRecurring')" on-complete="vm.goTo()")
coinify-email(ng-if="vm.onStep('email')" on-complete="vm.goTo('signup')" on-close="vm.close(0)" email="vm.user.email" valid-email="vm.state.email.valid" verified="vm.user.isEmailVerified" on-email-change="vm.onEmailChange(true)")
coinify-signup(ng-if="vm.onStep('signup')" on-complete="vm.onSignupComplete()" on-error="vm.goTo('email')" on-close="vm.close(0)" email="vm.user.email" valid-email="vm.state.email.valid" on-email-change="vm.onEmailChange(false)" fiat-currency="vm.fiatCurrency()")
div(ng-if="vm.onStep('select-payment-medium')" ng-controller="CoinifyMediumController" ng-include="'partials/coinify/medium.pug'")
Expand Down
1 change: 1 addition & 0 deletions app/partials/coinify/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select
frequencies="frequencyOptions"
on-success="buyHandler(quote, null, frequency, endTime)"
recurring-buy-limit="recurringBuyLimit()"
show-recurring="showRecurringBuy"
handle-quote="buyQuoteHandler(amount, baseCurr, quoteCurr)")
.flex-column.ml-60.col-md-5.col-sm-12.col-xs-12.pln.prn.pv-10-mobile.no-margin-mobile.hidden-xs
.mb-20(ng-show="showRecurringBuy && !hasDismissedRecurringBuyIntro()")
Expand Down
3 changes: 2 additions & 1 deletion assets/js/components/exchange/exchange-checkout.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ angular
fiatOptions: '<',
frequencies: '<',
collapseSummary: '<',
showRecurring: '<',
recurringBuyLimit: '&',
onSuccess: '&',
fiatChange: '&',
Expand Down Expand Up @@ -175,7 +176,7 @@ function ExchangeCheckoutController (Env, AngularHelper, $scope, $rootScope, $ti

Env.then(env => {
$scope.qaDebugger = env.qaDebugger;
this.showRecurringBuy = env.partners.coinify.showRecurringBuy && MyWallet.wallet.accountInfo.countryCodeGuess !== 'UK';
this.showRecurringBuy = this.showRecurring;
});
$scope.$on('$destroy', $scope.cancelRefresh);
AngularHelper.installLock.call($scope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, Angul
$state.params.selectedTab = this.selectedTab;
}
};
$scope.showRecurringBuy = MyWallet.wallet.accountInfo.countryCodeGuess !== 'UK' && env.partners.coinify.showRecurringBuy;
$scope.showRecurringBuy = MyWallet.wallet.accountInfo.countryCodeGuess !== 'UK' && env.partners.coinify.showRecurringBuy && $scope.exchange.profile.tradeSubscriptionsAllowed;

if (env.qaDebugger) {
$scope.qaDebugger = env.qaDebugger;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function AppRouter ($stateProvider, $urlRouterProvider) {
accounts ($injector, $q) {
let MyWallet = $injector.has('MyWallet') && $injector.get('MyWallet');
let sfox = MyWallet.wallet && MyWallet.wallet.external && MyWallet.wallet.external.sfox;

return sfox && sfox.hasAccount
? $q.resolve([])
.then(() => sfox.getBuyMethods()).catch(console.log)
Expand Down

0 comments on commit b0037e1

Please sign in to comment.