From 9e33cde4cf8bdc08a5ab933e0bbff89615bf3b1b Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Jan 2017 11:00:51 -0300 Subject: [PATCH] add badge to recent txs --- src/js/controllers/tab-home.js | 5 +++-- src/js/services/profileService.js | 7 ++++--- src/sass/views/tab-home.scss | 4 ++++ www/views/activity.html | 2 +- www/views/tab-home.html | 1 + 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index ac2a6b471..dcd495d89 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -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(); diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index dabffc717..a9416fcf3 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -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); }; }); }); diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 692224cf2..6fd937188 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -135,4 +135,8 @@ position: absolute; } } + + .badge { + top:11px; + } } diff --git a/www/views/activity.html b/www/views/activity.html index 8586e97e9..720ffb4e3 100644 --- a/www/views/activity.html +++ b/www/views/activity.html @@ -10,7 +10,7 @@
- +
Updating... Please stand by
diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 04bedc98d..909c332d4 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -47,6 +47,7 @@ Recent Transactions + {{notificationsN}}