From db02cbb575018d5ecef8fe4e9845a90290309523 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 8 Jan 2019 14:33:47 +0100 Subject: [PATCH] Always refresh notifications --- src/js/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/main.js b/src/js/main.js index 1c221410f..52423aea7 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -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); }); }