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

Commit

Permalink
fix(Recurring Buy): forgotten semis
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Apr 10, 2018
1 parent f57d775 commit b0a8a29
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions assets/js/components/coinify/recurring-confirm.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ function CoinifyRecurringConfirmController (recurringTrade, coinify) {
this.needsMoreTrades = coinify.trades.filter((t) => coinify.tradeStateIn(coinify.states.completed)(t) && !t.tradeSubscriptionId && t.medium === 'card').length < 3;

const determineState = () => {
if (this.needsKyc && this.needsMoreTrades) return 'NEEDS_KYC_AND_TRADES'
if (this.needsKyc && this.needsMoreTrades) return 'NEEDS_KYC_AND_TRADES';
if (this.needsKyc) return 'NEEDS_KYC';
if (this.needsMoreTrades) return 'NEEDS_TRADES';
return 'PROCEED';
}
};
this.state = determineState();
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ function ExchangeRecurringController ($scope, currency, recurringTrade) {

$scope.endTime = this.endTime && new Date(this.endTime).toDateString();
$scope.timespan = recurringTrade.getTimespan($scope.date, frequency);
$scope.paymentFee = this.paymentFee || parseFloat((this.trade.sendAmount / 100).toFixed(2)) - this.trade.fiatAmount
$scope.paymentFee = this.paymentFee || parseFloat((this.trade.sendAmount / 100).toFixed(2)) - this.trade.fiatAmount;
}
4 changes: 2 additions & 2 deletions assets/js/controllers/coinify/coinify.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function CoinifyController ($rootScope, $scope, $q, $state, $timeout, $uibModalI
this.transactionFee = () => this.mediums ? this.mediums[this.medium || 'card'].outFixedFees['BTC'] * 1e8 : 0;
this.timeToExpiration = () => this.quote ? this.quote.expiresAt - this.now() : this.trade.expiresAt - this.now();
this.needsKYCForRecurring = this.exchange.profile.level && this.exchange.profile.level.name < 2;
this.triggerKYCForRecurring = () => { coinify.getOpenKYC(); this.trade = exchange.kycs[0]; this.goTo('isx') }
this.triggerKYCForRecurring = () => { coinify.getOpenKYC(); this.trade = exchange.kycs[0]; this.goTo('isx'); };
this.refreshQuote = () => {
if (this.baseFiat()) return $q.resolve(coinify.getQuote(this.fiatAmount() * 100, this.quote.baseCurrency)).then((q) => this.quote = q);
else return $q.resolve(coinify.getQuote(this.BTCAmount(), this.quote.baseCurrency, this.quote.quoteCurrency)).then((q) => this.quote = q);
Expand Down Expand Up @@ -106,7 +106,7 @@ function CoinifyController ($rootScope, $scope, $q, $state, $timeout, $uibModalI
this.goTo = (step) => this.step = this.steps[step];

if (frequency && this.quote) {
this.goTo('confirm-recurring')
this.goTo('confirm-recurring');
} else if (!this.user.isEmailVerified && !this.exchange.user) {
this.goTo('email');
} else if (!this.exchange.user) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function CoinifyCheckoutController ($scope, $rootScope, $stateParams, Env, Angul
$scope.recurringBuyLimit = () => $scope.exchange.user ? coinify.limits.card.inRemaining[$scope.buyFiat.code] : 300;

$scope.nextRecurring = () => coinify.getNextRecurringTrade();
$scope.nextRecurringTimespan = () => $scope.nextRecurring().date && recurringTrade.getTimespan(new Date($scope.nextRecurring().date), $scope.nextRecurring().frequency)
$scope.nextRecurringTimespan = () => $scope.nextRecurring().date && recurringTrade.getTimespan(new Date($scope.nextRecurring().date), $scope.nextRecurring().frequency);

$scope.selling = coinify.selling;
$scope.sellHandler = modals.openSellView;
Expand Down
4 changes: 2 additions & 2 deletions assets/js/services/coinify.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ function coinify (Env, BrowserHelper, $timeout, $q, $state, $uibModal, $uibModal
frequency: activeSub[0].frequency,
fee: fee.toFixed(2)};
}
return false
}
return false;
};

return service;
}
2 changes: 1 addition & 1 deletion assets/js/services/wallet.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function Wallet ($http, $window, $timeout, $location, $injector, Alerts, MyWalle
history.push(wallet.my.wallet.getHistory());

if (BlockchainConstants.NETWORK === 'testnet') {
didFetchTransactions()
didFetchTransactions();
} else {
let Ethereum = $injector.get('Ethereum');
if (Ethereum.eth) history.push(Ethereum.fetchHistory());
Expand Down

0 comments on commit b0a8a29

Please sign in to comment.