feat(client): Add notification badge

fixes #4365
closes #7755
This commit is contained in:
Luan
2016-07-02 21:38:38 -03:00
committed by Blade Barringer
parent 28ebc92aa9
commit bac1405a20
3 changed files with 36 additions and 0 deletions

View File

@@ -29,6 +29,32 @@ angular.module('habitrpg')
$scope.clearMessages = Chat.markChatSeen;
$scope.clearCards = Chat.clearCards;
$scope.getNotificationsCount = function() {
var count = 0;
if($scope.user.invitations.party && $scope.user.invitations.party.id){
count++;
}
if($scope.user.purchased.plan && $scope.user.purchased.plan.mysteryItems.length){
count++;
}
if($scope.user.invitations.guilds){
count += $scope.user.invitations.guilds.length;
}
if($scope.user.flags.classSelected && !$scope.user.preferences.disableClasses && $scope.user.stats.points){
count += $scope.user.stats.points > 0 ? 1 : 0;
}
if($scope.user.newMessages) {
count += Object.keys($scope.user.newMessages).length;
}
return count;
};
$scope.iconClasses = function() {
return selectNotificationValue(
'glyphicon-gift',