fix(filters): reload tasks silently when marking one done in the list
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This fixes a UI issue where if a user had a filter set and marked the task done, it would not disappear, even though the filter does not match the done task anymore.
This commit is contained in:
parent
bea81f83f7
commit
526bd1f170
@ -73,7 +73,7 @@
|
||||
>
|
||||
<template v-if="canWrite">
|
||||
<span class="icon handle">
|
||||
<Icon icon="grip-lines" />
|
||||
<Icon icon="grip-lines"/>
|
||||
</span>
|
||||
</template>
|
||||
</SingleTaskInProject>
|
||||
@ -220,6 +220,13 @@ function updateTaskList(task: ITask) {
|
||||
}
|
||||
|
||||
function updateTasks(updatedTask: ITask) {
|
||||
if (props.projectId < 0) {
|
||||
// In the case of a filter, we'll reload the filter in the background to avoid tasks which do
|
||||
// not match the filter show up here
|
||||
loadTasks(false)
|
||||
return
|
||||
}
|
||||
|
||||
for (const t in tasks.value) {
|
||||
if (tasks.value[t].id === updatedTask.id) {
|
||||
tasks.value[t] = updatedTask
|
||||
@ -308,7 +315,7 @@ function prepareFiltersAndLoadTasks() {
|
||||
|
||||
.list-view {
|
||||
padding-bottom: 1rem;
|
||||
|
||||
|
||||
:deep(.card) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
@ -105,8 +105,10 @@ export function useTaskList(
|
||||
const totalPages = computed(() => taskCollectionService.totalPages)
|
||||
|
||||
const tasks = ref<ITask[]>([])
|
||||
async function loadTasks() {
|
||||
tasks.value = []
|
||||
async function loadTasks(resetBeforeLoad: boolean = true) {
|
||||
if(resetBeforeLoad) {
|
||||
tasks.value = []
|
||||
}
|
||||
try {
|
||||
tasks.value = await taskCollectionService.getAll(...getAllTasksParams.value)
|
||||
} catch (e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user