Add reconnect handler and make reboot state better reflected in the notfications
This commit is contained in:
@@ -41,12 +41,12 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
|
||||
});
|
||||
};
|
||||
|
||||
function refreshNotifications() {
|
||||
Client.getNotifications(false, 1, 20, function (error, results) {
|
||||
function refreshNotifications(poll) {
|
||||
Client.getNotifications(false, 1, 100, function (error, results) {
|
||||
if (error) console.error(error);
|
||||
else $scope.notifications = results;
|
||||
|
||||
$timeout(refreshNotifications, 60 * 1000);
|
||||
if (poll) $timeout(refreshNotifications, 60 * 1000);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
|
||||
|
||||
$scope.initialized = true;
|
||||
|
||||
refreshNotifications();
|
||||
refreshNotifications(true);
|
||||
|
||||
$scope.updateSubscriptionStatus();
|
||||
});
|
||||
@@ -127,6 +127,10 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
|
||||
}
|
||||
});
|
||||
|
||||
Client.onReconnect(function () {
|
||||
refreshNotifications(false);
|
||||
});
|
||||
|
||||
init();
|
||||
|
||||
// setup all the dialog focus handling
|
||||
|
||||
Reference in New Issue
Block a user