fix(filters): reload tasks silently when marking one done in the list
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
@ -220,6 +220,13 @@ function updateTaskList(task: ITask) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateTasks(updatedTask: 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) {
|
for (const t in tasks.value) {
|
||||||
if (tasks.value[t].id === updatedTask.id) {
|
if (tasks.value[t].id === updatedTask.id) {
|
||||||
tasks.value[t] = updatedTask
|
tasks.value[t] = updatedTask
|
||||||
|
@ -105,8 +105,10 @@ export function useTaskList(
|
|||||||
const totalPages = computed(() => taskCollectionService.totalPages)
|
const totalPages = computed(() => taskCollectionService.totalPages)
|
||||||
|
|
||||||
const tasks = ref<ITask[]>([])
|
const tasks = ref<ITask[]>([])
|
||||||
async function loadTasks() {
|
async function loadTasks(resetBeforeLoad: boolean = true) {
|
||||||
|
if(resetBeforeLoad) {
|
||||||
tasks.value = []
|
tasks.value = []
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
tasks.value = await taskCollectionService.getAll(...getAllTasksParams.value)
|
tasks.value = await taskCollectionService.getAll(...getAllTasksParams.value)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user