mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added param to filter challenges by guild when a challenge is first clicked from guild
This commit is contained in:
@@ -5,6 +5,8 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
||||
// challenge
|
||||
$scope.cid = $state.params.cid;
|
||||
|
||||
$scope.groupIdFilter = $stateParams.groupIdFilter;
|
||||
|
||||
_getChallenges();
|
||||
|
||||
// FIXME $scope.challenges needs to be resolved first (see app.js)
|
||||
@@ -381,6 +383,11 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
||||
_isMember: "either",
|
||||
_isOwner: "either"
|
||||
};
|
||||
//If we game from a group, then override the filter to that group
|
||||
if ($scope.groupIdFilter) {
|
||||
$scope.search.group = {};
|
||||
$scope.search.group[$scope.groupIdFilter] = true ;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user