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

View File

@@ -71,8 +71,9 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
}
// update state of acknowledged notification
$scope.notificationAcknowledged = function (ack) {
$scope.notificationCount += (ack ? -1 : +1);
$scope.notificationAcknowledged = function () {
if ($scope.notificationCount === 0) return; // already down to 0
$scope.notificationCount--;
};
function init() {