mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Fixes #4816
This commit is contained in:
@@ -391,8 +391,13 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.sync = function(group){
|
$scope.sync = function(group){
|
||||||
|
if(group.type == 'party') {
|
||||||
|
group.$syncParty(); // Syncs the whole party, not just 15 members
|
||||||
|
} else {
|
||||||
group.$get();
|
group.$get();
|
||||||
//When the user clicks fetch recent messages we need to update that the user has seen the new messages
|
}
|
||||||
|
// When the user clicks fetch recent messages we need to update
|
||||||
|
// that the user has seen the new messages
|
||||||
Chat.seenMessage(group._id);
|
Chat.seenMessage(group._id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -516,7 +521,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
$scope.newGroup = new Groups.Group({type:'party'});
|
$scope.newGroup = new Groups.Group({type:'party'});
|
||||||
|
|
||||||
if ($state.is('options.social.party')) {
|
if ($state.is('options.social.party')) {
|
||||||
$scope.group.$get(); // Sync party automatically when navigating to party page
|
$scope.group.$syncParty(); // Sync party automatically when navigating to party page
|
||||||
}
|
}
|
||||||
|
|
||||||
Chat.seenMessage($scope.group._id);
|
Chat.seenMessage($scope.group._id);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ function(ApiUrl, $resource, $q, $http, User, Challenges) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
syncParty: {method: "GET", url: '/api/v2/groups/party'},
|
||||||
join: {method: "POST", url: ApiUrl.get() + '/api/v2/groups/:gid/join'},
|
join: {method: "POST", url: ApiUrl.get() + '/api/v2/groups/:gid/join'},
|
||||||
leave: {method: "POST", url: ApiUrl.get() + '/api/v2/groups/:gid/leave'},
|
leave: {method: "POST", url: ApiUrl.get() + '/api/v2/groups/:gid/leave'},
|
||||||
invite: {method: "POST", url: ApiUrl.get() + '/api/v2/groups/:gid/invite'},
|
invite: {method: "POST", url: ApiUrl.get() + '/api/v2/groups/:gid/invite'},
|
||||||
|
|||||||
Reference in New Issue
Block a user