mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
v3 client: only load completed todos once
This commit is contained in:
@@ -150,9 +150,12 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
|||||||
$scope._today = moment().add({days: 1});
|
$scope._today = moment().add({days: 1});
|
||||||
|
|
||||||
$scope.loadedCompletedTodos = function () {
|
$scope.loadedCompletedTodos = function () {
|
||||||
|
if (Tasks.loadedCompletedTodos === true) return;
|
||||||
|
|
||||||
Tasks.getUserTasks(true)
|
Tasks.getUserTasks(true)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
User.user.todos.concat(response.data.data);
|
User.user.todos = User.user.todos.concat(response.data.data);
|
||||||
|
Tasks.loadedCompletedTodos = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ angular.module('habitrpg')
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
getUserTasks: getUserTasks,
|
getUserTasks: getUserTasks,
|
||||||
|
loadedCompletedTodos: false,
|
||||||
createUserTasks: createUserTasks,
|
createUserTasks: createUserTasks,
|
||||||
getChallengeTasks: getChallengeTasks,
|
getChallengeTasks: getChallengeTasks,
|
||||||
createChallengeTasks: createChallengeTasks,
|
createChallengeTasks: createChallengeTasks,
|
||||||
|
|||||||
Reference in New Issue
Block a user