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() { var getNotifications = function() {
profileService.getNotifications({ profileService.getNotifications({
limit: 3 limit: 3
}, function(err, n) { }, function(err, notifications, total) {
if (err) { if (err) {
$log.error(err); $log.error(err);
return; return;
} }
$scope.notifications = n; $scope.notifications = notifications;
$scope.notificationsN = total;
$timeout(function() { $timeout(function() {
$ionicScrollDelegate.resize(); $ionicScrollDelegate.resize();
$scope.$apply(); $scope.$apply();

View file

@ -797,7 +797,7 @@ angular.module('copayApp.services')
opts = opts || {}; opts = opts || {};
var TIME_STAMP = 60 * 60 * 6; var TIME_STAMP = 60 * 60 * 6;
var MAX = 100; var MAX = 30;
var typeFilter = { var typeFilter = {
'NewOutgoingTx': 1, 'NewOutgoingTx': 1,
@ -925,7 +925,8 @@ angular.module('copayApp.services')
if (j == l) { if (j == l) {
notifications = lodash.sortBy(notifications, 'createdOn'); notifications = lodash.sortBy(notifications, 'createdOn');
notifications = lodash.compact(lodash.flatten(notifications)).slice(0, MAX); 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; position: absolute;
} }
} }
.badge {
top:11px;
}
} }

View file

@ -10,7 +10,7 @@
<div ng-if="fetchingNotifications" class="updatingHistory"> <div ng-if="fetchingNotifications" class="updatingHistory">
<div class="text-center"> <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 translate>Updating... Please stand by</div>
</div> </div>
</div> </div>

View file

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