add badge to recent txs

This commit is contained in:
Matias Alejo Garcia 2017-01-18 11:00:51 -03:00
commit 9e33cde4cf
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
5 changed files with 13 additions and 6 deletions

View file

@ -242,12 +242,13 @@ angular.module('copayApp.controllers').controller('tabHomeController',
var getNotifications = function() {
profileService.getNotifications({
limit: 3
}, function(err, n) {
}, function(err, notifications, total) {
if (err) {
$log.error(err);
return;
}
$scope.notifications = n;
$scope.notifications = notifications;
$scope.notificationsN = total;
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();

View file

@ -796,8 +796,8 @@ angular.module('copayApp.services')
root.getNotifications = function(opts, cb) {
opts = opts || {};
var TIME_STAMP = 60 * 60 * 6;
var MAX = 100;
var TIME_STAMP = 60 * 60 * 6;
var MAX = 30;
var typeFilter = {
'NewOutgoingTx': 1,
@ -925,7 +925,8 @@ angular.module('copayApp.services')
if (j == l) {
notifications = lodash.sortBy(notifications, 'createdOn');
notifications = lodash.compact(lodash.flatten(notifications)).slice(0, MAX);
return cb(null, process(notifications));
var total = notifications.length;
return cb(null, process(notifications), total);
};
});
});