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