Only enable notification ack button if there are any unread ones

This commit is contained in:
Johannes Zellner
2021-06-21 14:04:25 +02:00
parent 90112de6e4
commit b27b4a38eb
2 changed files with 4 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
$scope.notifications = [];
$scope.activeNotification = null;
$scope.busy = true;
$scope.hasUnread = false;
$scope.currentPage = 1;
$scope.perPage = 20;
@@ -27,6 +28,7 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
});
$scope.notifications = result;
$scope.hasUnread = !!result.find(function (n) { return !n.acknowledged; });
$scope.busy = false;
});
@@ -76,6 +78,7 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
}, function (error) {
if (error) console.error(error);
$scope.hasUnread = false;
$scope.clearAllBusy = false;
});
};