fix(tasks): don't load tasks multiple times when viewing list or gantt view
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2024-01-26 21:33:20 +01:00
parent 3c1041902e
commit 78d4a518a3
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 6 additions and 3 deletions

View File

@ -36,7 +36,7 @@ import Filters from '@/components/project/partials/filters.vue'
import {getDefaultParams} from '@/composables/useTaskList' import {getDefaultParams} from '@/composables/useTaskList'
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
required: true, required: true,
}, },
@ -48,6 +48,9 @@ const value = computed({
return props.modelValue return props.modelValue
}, },
set(value) { set(value) {
if(props.modelValue === value) {
return
}
emit('update:modelValue', value) emit('update:modelValue', value)
}, },
}) })
@ -59,7 +62,7 @@ watch(
}, },
{immediate: true}, {immediate: true},
) )
const hasFilters = computed(() => { const hasFilters = computed(() => {
// this.value also contains the page parameter which we don't want to include in filters // this.value also contains the page parameter which we don't want to include in filters
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars

View File

@ -300,7 +300,7 @@ function prepareFiltersAndLoadTasks() {
sortByParam.value = {} sortByParam.value = {}
sortByParam.value[ALPHABETICAL_SORT] = 'asc' sortByParam.value[ALPHABETICAL_SORT] = 'asc'
} }
loadTasks() loadTasks()
} }
</script> </script>