add notifications, fix too many seen requests and misc fixes

This commit is contained in:
Matteo Pagliazzi
2016-09-09 20:12:17 +02:00
parent a748e57cd7
commit 98df0f26e7
5 changed files with 46 additions and 18 deletions

View File

@@ -24,6 +24,12 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
$scope.group = $rootScope.party;
$scope.group.loadingParty = false;
checkForNotifications();
if ($state.is('options.social.party')) {
if ('Notification' in window && window.Notification.permission === 'default') {
window.Notification.requestPermission();
}
Chat.markChatSeen($scope.group._id);
}
}
function handlePartyError (response) {
@@ -52,10 +58,6 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
}
}
if ($scope.group && $scope.group._id) {
Chat.markChatSeen($scope.group._id);
}
$scope.create = function(group) {
group.loadingParty = true;