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);
};
});
});

View file

@ -135,4 +135,8 @@
position: absolute;
}
}
.badge {
top:11px;
}
}

View file

@ -10,7 +10,7 @@
<div ng-if="fetchingNotifications" class="updatingHistory">
<div class="text-center">
<ion-spinner class="spinner-dark" icon="lines"></ion-spinner>
<ion-spinner class="spinner-dark" icon="crescent"></ion-spinner>
<div translate>Updating... Please stand by</div>
</div>
</div>

View file

@ -47,6 +47,7 @@
<a class="item item-icon-right item-heading" ui-sref="tabs.activity">
<span translate>Recent Transactions</span>
<i class="icon bp-arrow-right"></i>
<span class="badge badge-assertive m5t m10r" ng-show="notificationsN>3"> {{notificationsN}}</span>
</a>
<a class="item item-sub activity" ng-repeat="notification in notifications" ng-click="openNotificationModal(notification)">
<span ng-include="'views/includes/walletActivity.html'"></span>