mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Use _.find for clickStart Quest
This commit is contained in:
@@ -537,8 +537,12 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
||||
};
|
||||
|
||||
$scope.clickStartQuest = function(){
|
||||
if (_.reduce(User.user.items.quests, function(a,v){a += v; return a}) > 0){
|
||||
$rootScope.openModal("ownedQuests", {controller:"InventoryCtrl"});
|
||||
var hasQuests = _.find(User.user.items.quests, function(quest) {
|
||||
return quest > 0;
|
||||
});
|
||||
|
||||
if (hasQuests){
|
||||
$rootScope.openModal("ownedQuests", { controller:"InventoryCtrl" });
|
||||
} else {
|
||||
$rootScope.$state.go('options.inventory.quests');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user