mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user