From 4ce9ac9c669254fe32d66116bb1e4e5a5cbba167 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 20 Feb 2022 21:32:02 +0100 Subject: [PATCH] chore: remove showAll prop and make it a computed instead --- src/views/Home.vue | 1 - src/views/tasks/ShowTasks.vue | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index b5bcae971..ac82f2615 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -53,7 +53,6 @@ diff --git a/src/views/tasks/ShowTasks.vue b/src/views/tasks/ShowTasks.vue index 51b055802..d14203cab 100644 --- a/src/views/tasks/ShowTasks.vue +++ b/src/views/tasks/ShowTasks.vue @@ -72,23 +72,22 @@ const showNothingToDo = ref(false) setTimeout(() => showNothingToDo.value = true, 100) -// NOTE: You MUST provide either dateFrom and dateTo OR showAll for the component to actually show tasks. // Linting disabled because we explicitely enabled destructuring in vite's config, this will work. // eslint-disable-next-line vue/no-setup-props-destructure const { dateFrom, dateTo, - showAll = false, showNulls = false, showOverdue = false, } = defineProps<{ dateFrom?: Date | string, dateTo?: Date | string, - showAll?: Boolean, showNulls?: Boolean, showOverdue?: Boolean, }>() +const showAll = computed(() => typeof dateFrom === 'undefined' || typeof dateTo === 'undefined') + const pageTitle = computed(() => { let title = '' @@ -190,7 +189,7 @@ async function loadPendingTasks(from: string, to: string) { filterIncludeNulls: showNulls, } - if (!showAll) { + if (!showAll.value) { params.filterBy.push('due_date') params.filterValue.push(to) params.filterComparator.push('less')