fix: Prevent message from displaying if no new messages exist

This commit is contained in:
Blade Barringer
2016-06-19 08:38:07 -05:00
parent b62fbab6f8
commit 941ff10cdc
2 changed files with 5 additions and 6 deletions

View File

@@ -22,8 +22,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
$rootScope.pageTitle = $state.current.title;
if (!!fromState.name) Analytics.track({'hitType':'pageview','eventCategory':'navigation','eventAction':'navigate','page':'/#/'+toState.name});
// clear inbox when entering inbox tab
if (toState.name=='options.social.inbox') {
if (toState.name=='options.social.inbox' && User.user.inbox && User.user.inbox.newMessages > 0) {
User.clearNewMessages();
}
});
@@ -44,7 +43,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
$rootScope.toJson = angular.toJson;
$rootScope.Payments = Payments;
$rootScope.userNotifications = [];
// Angular UI Router
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;