We don't allow setting notifications to unread anymore so also prevent state issues when decreasing the counter

This commit is contained in:
Johannes Zellner
2021-06-30 17:24:41 +02:00
parent 7c15c26fa9
commit 59f257346d
3 changed files with 10 additions and 14 deletions
+6 -8
View File
@@ -46,16 +46,14 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
$scope.refresh();
};
$scope.ack = function (notification, acked, event) {
if (event) event.stopPropagation();
$scope.ack = function (notification) {
if (notification.acknowledged) return;
if (notification.acknowledged === acked) return;
Client.ackNotification(notification.id, acked, function (error) {
Client.ackNotification(notification.id, true, function (error) {
if (error) console.error(error);
notification.acknowledged = acked;
$scope.$parent.notificationAcknowledged(acked);
notification.acknowledged = true;
$scope.$parent.notificationAcknowledged();
});
};
@@ -70,7 +68,7 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
console.error(error);
} else {
notification.acknowledged = true;
$scope.$parent.notificationAcknowledged(true);
$scope.$parent.notificationAcknowledged();
}
callback();