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): fix next recurring; add icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Apr 10, 2018
1 parent f81a403 commit 007a832
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/partials/coinify/checkout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ bc-tabs(tab="tabs.selectedTab" tab-options="tabs.options" on-select="tabs.select
trade="trade")
div(ng-show="recurringTrades().length")
.flex-row.flex-between.flex-center.mtl
h4.type-h5 Recurring Orders
.flex-row.flex-center
i.icon-recurring.mr-5
h4.type-h5 Recurring Orders
div(ng-hide="pendingTrades().length")
span.hidden-xs(ng-show="exchange.profile.email") Coinify Account: {{ exchange.profile.email }}
.width-100
Expand Down
5 changes: 3 additions & 2 deletions app/templates/exchange/recurring.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.flex-row.flex-between.mbm
div
.flex
i.icon-recurring.mr-5
span.primary.em-500 This is a Recurring Order
helper-button(content="RECURRING_HELPER")
a.em-300.text-danger.underline(ng-show="$ctrl.showRemove" ng-click="$ctrl.onRemove()") Remove Recurring Order
Expand All @@ -8,7 +9,7 @@
span.f-13(translate="RECURRING_REMINDER" translate-values="{time: $ctrl.frequency}")
.flex-row.phm.pv-5
span.flex-1.primary.colon(translate="AMOUNT")
span.flex-5.ph-5-mobile {{ format($ctrl.trade.fiatAmount, $ctrl.dollars, true) }} (+ {{ $ctrl.paymentFee | format }} {{ $ctrl.dollars.code }} Payment Fee)
span.flex-5.ph-5-mobile {{ format($ctrl.trade.fiatAmount, $ctrl.dollars, true) }} (+ {{ paymentFee | format }} {{ $ctrl.dollars.code }} Payment Fee)
.flex-row.phm.pv-5
span.flex-1.primary.colon(translate="FREQUENCY")
span.flex-5.ph-5-mobile(translate="FREQUENCY_INFO" translate-values="{timespan: timespan}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +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
}
4 changes: 2 additions & 2 deletions assets/js/services/coinify.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ function coinify (Env, BrowserHelper, $timeout, $q, $state, $uibModal, $uibModal
};

service.getNextRecurringTrade = () => {
if (service.subscriptions.length) {
let activeSub = service.subscriptions.filter(s => s.isActive);
let activeSub = service.subscriptions.filter(s => s.isActive);
if (activeSub.length) {
let matchingTrades = service.trades.filter(t => t.tradeSubscriptionId === activeSub[0].id);
let trade = matchingTrades.sort((a, b) => a.createdAt < b.createdAt);
const fee = (trade[0].sendAmount / 100) - (trade[0].inAmount / 100);
Expand Down

0 comments on commit 007a832

Please sign in to comment.