Skip to content

Commit

Permalink
respects landing page filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Benimautner committed Feb 12, 2024
1 parent f915095 commit 515be2e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/pages/landing_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,19 @@ class LandingPageState extends State<LandingPage>
.settingsManager
.getLandingPageOnlyDueDateTasks()
.then((showOnlyDueDateTasks) {
return VikunjaGlobal
.of(context)
.taskService

VikunjaGlobalState global = VikunjaGlobal.of(context);
Map<String, dynamic>? frontend_settings = global.currentUser?.settings?.frontend_settings;
int? filterId = 0;
if(frontend_settings != null) {
if(frontend_settings["filter_id_used_on_overview"] != null)
filterId = frontend_settings["filter_id_used_on_overview"];
}
if(filterId != null && filterId != 0) {
return global.taskService.getAllByProject(filterId).then<Future<void>?>((response) => _handleTaskList(response?.body, showOnlyDueDateTasks));;
}

return global.taskService
.getByOptions(TaskServiceOptions(
newOptions: [
TaskServiceOption<TaskServiceOptionSortBy>("sort_by", ["due_date", "id"]),
Expand Down

0 comments on commit 515be2e

Please sign in to comment.