Only enable notification ack button if there are any unread ones
This commit is contained in:
@@ -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;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user