mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Filter dailies by due/not due in group plan and challenge page (#10582)
* sort by isDue works but only on refresh * update isDue for new tasks * apply correct filter to challenge page
This commit is contained in:
committed by
Matteo Pagliazzi
parent
b977d42402
commit
cce9b33844
@@ -362,7 +362,7 @@ export default {
|
||||
type: this.type,
|
||||
filterType: this.activeFilter.label,
|
||||
}) :
|
||||
this.filterByCompleted(this.taskListOverride, this.activeFilter.label);
|
||||
this.filterByLabel(this.taskListOverride, this.activeFilter.label);
|
||||
|
||||
let taggedList = this.filterByTagList(filteredTaskList, this.selectedTags);
|
||||
let searchedList = this.filterBySearchText(taggedList, this.searchText);
|
||||
@@ -598,10 +598,12 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
filterByCompleted (taskList, filter) {
|
||||
filterByLabel (taskList, filter) {
|
||||
if (!taskList) return [];
|
||||
return taskList.filter(task => {
|
||||
if (filter === 'complete2') return task.completed;
|
||||
if (filter === 'due') return task.isDue;
|
||||
if (filter === 'notDue') return !task.isDue;
|
||||
return !task.completed;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user