v3: misc fixes

This commit is contained in:
Matteo Pagliazzi
2016-05-18 12:16:31 +02:00
parent d888fc7588
commit 210ac57165
5 changed files with 12 additions and 9 deletions

View File

@@ -292,8 +292,8 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
} else if (spell.target == 'tasks') {
var tasks = User.user.habits.concat(User.user.dailys).concat(User.user.rewards).concat(User.user.todos);
// exclude challenge tasks
tasks = tasks.filter(function (t) {
if (!t.challenge) return true;
tasks = tasks.filter(function (task) {
if (!task.challenge) return true;
return (!task.challenge.id || task.challenge.broken);
});
$scope.castEnd(tasks, 'tasks');