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