Always refresh notifications
This commit is contained in:
@@ -73,6 +73,10 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
|
||||
|
||||
function refreshNotifications() {
|
||||
Client.getNotifications(false, 1, 20, function (error, results) {
|
||||
$timeout(refreshNotifications, 10000);
|
||||
|
||||
if (error) return console.error(error);
|
||||
|
||||
var newNotifications = results.filter(function (a) {
|
||||
return !$scope.notifications.find(function (b) {
|
||||
return a.id === b.id;
|
||||
@@ -84,7 +88,6 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
|
||||
Client.notify(n.title, n.message, false, 'info', n.action);
|
||||
});
|
||||
|
||||
$timeout(refreshNotifications, 10000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user