mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 12:48:52 +00:00
refactor(client): assign tasks data to tasks variable on initial sync
This commit is contained in:
parent
138217fe6a
commit
cfacf039df
1 changed files with 3 additions and 2 deletions
|
|
@ -70,7 +70,8 @@ angular.module('habitrpg')
|
|||
}
|
||||
|
||||
function sync() {
|
||||
var tasks = [];
|
||||
var tasks;
|
||||
|
||||
return $http({
|
||||
method: "GET",
|
||||
url: '/api/v3/user/',
|
||||
|
|
@ -106,7 +107,7 @@ angular.module('habitrpg')
|
|||
})
|
||||
// refresh all but completed todos
|
||||
.then(function (response) {
|
||||
tasks.push.apply(tasks, response.data.data);
|
||||
tasks = response.data.data;
|
||||
|
||||
// only refresh completed todos if the user has the completed tabs list open
|
||||
if ($rootScope.lists && $rootScope.$state && $rootScope.$state.current.name == 'tasks' && _.find($rootScope.lists, {'type':'todo'}).view == 'complete') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue