Update toplevel notification status

This commit is contained in:
Johannes Zellner
2019-01-08 12:36:08 +01:00
parent fa04bea64b
commit 38cb2201a9
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -127,6 +127,12 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
});
};
// update state of acknowledged notification
$scope.notificationAcknowledged = function (notificationId) {
// remove notification from list
$scope.notifications = $scope.notifications.filter(function (n) { return n.id !== notificationId; });
};
Client.getStatus(function (error, status) {
if (error) return $scope.error(error);
+2
View File
@@ -394,6 +394,8 @@ angular.module('Application').controller('AccountController', ['$scope', 'Client
Client.ackNotification(notification.id, function (error) {
if (error) return console.error(error);
$scope.$parent.notificationAcknowledged(notification.id);
if (notification.action) window.location = notification.action;
else refreshNotifications();
});