We don't allow setting notifications to unread anymore so also prevent state issues when decreasing the counter
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user