mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
[#1710] fix to party-in-header
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User',
|
||||
function($scope, Groups, User) {
|
||||
$scope.party = Groups.party();
|
||||
$scope.partyMinusSelf = _.filter($scope.party, function(member){
|
||||
return member._id !== User.user._id;
|
||||
$scope.party = Groups.party(function(){
|
||||
$scope.partyMinusSelf = _.filter($scope.party.members, function(member){
|
||||
return member._id !== User.user._id;
|
||||
});
|
||||
});
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -22,12 +22,10 @@ angular.module('groupServices', ['ngResource']).
|
||||
// Defer loading everything until they're requested
|
||||
var party, myGuilds, publicGuilds, tavern;
|
||||
|
||||
// But we don't defer triggering Party, since we always need it for the header if nothing else
|
||||
party = Group.get({gid: 'party'});
|
||||
|
||||
return {
|
||||
party: function(){
|
||||
return party;
|
||||
party: function(cb){
|
||||
if (!party) return (party = Group.get({gid: 'party'}, cb));
|
||||
return (cb) ? cb(party) : party;
|
||||
},
|
||||
publicGuilds: function(){
|
||||
//TODO combine these as {type:'guilds,public'} and create a $filter() to separate them
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
i.icon-signal
|
||||
// party
|
||||
span(ng-controller='PartyCtrl')
|
||||
.herobox-wrap(ng-repeat='profile in party.members | filter:removeSelf')
|
||||
.herobox-wrap(ng-repeat='profile in partyMinusSelf')
|
||||
include avatar
|
||||
|
||||
.NPC-Bailey-Head(ng-show='user.flags.newStuff', tooltip='Psst', tooltip-placement='top', ng-click='modals.newStuff=true')
|
||||
|
||||
Reference in New Issue
Block a user