add badge to recent txs
This commit is contained in:
parent
a99a133814
commit
9e33cde4cf
5 changed files with 13 additions and 6 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -135,4 +135,8 @@
|
|||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
.badge {
|
||||
top:11px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue