Skip to content

Commit

Permalink
Merge pull request #246 from xenohunter/master
Browse files Browse the repository at this point in the history
Fixed leasing transactions amount
  • Loading branch information
Phil Filippak authored May 23, 2017
2 parents b34686f + 6ceb338 commit de29e3f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/js/dex/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@

ctrl.cancelOrder = function (order) {
// TODO : add a queue for the orders which weren't yet canceled.

// TODO : add different messages for cancel and delete actions.
dexOrderService
.removeOrder(ctrl.pair, order, sender)
.then(function () {
Expand Down
8 changes: 4 additions & 4 deletions src/js/dex/order.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
var signedRequest = matcherRequestService.buildCreateOrderRequest(order, sender);
return matcherApiService.createOrder(signedRequest);
}).catch(function (e) {
throw new Error(e); // TODO
throw new Error(e);
});
};

Expand All @@ -36,7 +36,7 @@
throw new Error();
}
}).catch(function (e) {
throw new Error(); // TODO
throw new Error(e);
});
} else if (order.status === FILLED || order.status === CANCELLED) {
return matcherApiService
Expand All @@ -46,7 +46,7 @@
throw new Error();
}
}).catch(function (e) {
throw new Error(e); // TODO
throw new Error(e);
});
}
};
Expand Down Expand Up @@ -81,7 +81,7 @@
});
})
.catch(function (e) {
throw new Error(e); // TODO
throw new Error(e);
});
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/js/leasing/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
intervalPromise;

ctrl.transactions = [];
ctrl.limitTo = 1000;
ctrl.balanceDetails = null;

refreshAll();
Expand Down Expand Up @@ -47,7 +48,7 @@

function refreshLeasingTransactions() {
transactionLoadingService
.loadTransactions(applicationContext.account)
.loadTransactions(applicationContext.account, ctrl.limitTo)
.then(function (transactions) {
ctrl.transactions = transactions.filter(function (tx) {
var startLeasing = constants.START_LEASING_TRANSACTION_TYPE,
Expand Down
11 changes: 7 additions & 4 deletions src/js/shared/transaction.loading.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@
var self = this;

// returns promise that loads and merges unconfirmed and confirmed transactions
this.loadTransactions = function (account) {
this.loadTransactions = function (account, limit) {
var unconfirmed;
return apiService.transactions.unconfirmed()
.then(function (response) {
unconfirmed = response;

return apiService.transactions.list(account.address);
return apiService.transactions.list(account.address, limit);
})
.then(function (response) {
var confirmed = response;
// FIXME : redo this when the API is fixed.
if (response[0] instanceof Array) {
response = response[0];
}

return self.mergeTransactions(account, unconfirmed, confirmed);
return self.mergeTransactions(account, unconfirmed, response);
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/templates/leasing/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@

<waves-transaction-history heading="LEASING TRANSACTIONS"
transactions="$ctrl.transactions"
limit-to="2000"></waves-transaction-history>
limit-to="$ctrl.limitTo"></waves-transaction-history>
</div>

0 comments on commit de29e3f

Please sign in to comment.