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