notifications cache and autorefresh

This commit is contained in:
Matias Alejo Garcia 2016-08-31 18:12:28 -03:00
commit e801fc2626
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
5 changed files with 152 additions and 132 deletions

View file

@ -4,17 +4,6 @@ angular.module('copayApp.controllers').controller('activityController',
function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo) {
var self = this;
var setNotifications = function(notifications) {
var n = walletService.processNotifications(notifications);
$scope.notifications = n;
$timeout(function() {
$scope.$apply();
}, 1);
};
$scope.init = function() {
$scope.fetchingNotifications = true;
@ -24,7 +13,10 @@ angular.module('copayApp.controllers').controller('activityController',
return;
}
$scope.fetchingNotifications = false;
setNotifications(n);
})
$scope.notifications = n;
$timeout(function() {
$scope.$apply();
}, 1);
});
}
});