fix: list view: don't sort tasks after marking one "done" (#3285)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
See https://community.vikunja.io/t/list-view-tasks-being-sorted-after-marking-one-done-throws-you-off/1257/2 Reviewed-on: #3285 Reviewed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-authored-by: WofWca <wofwca@protonmail.com> Co-committed-by: WofWca <wofwca@protonmail.com>
This commit is contained in:
parent
3643ffe0d0
commit
6870db4a72
|
@ -144,24 +144,6 @@ import {useTaskStore} from '@/stores/tasks'
|
||||||
|
|
||||||
import type {IProject} from '@/modelTypes/IProject'
|
import type {IProject} from '@/modelTypes/IProject'
|
||||||
|
|
||||||
function sortTasks(tasks: ITask[]) {
|
|
||||||
if (tasks === null || Array.isArray(tasks) && tasks.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return tasks.sort((a, b) => {
|
|
||||||
if (a.done < b.done)
|
|
||||||
return -1
|
|
||||||
if (a.done > b.done)
|
|
||||||
return 1
|
|
||||||
|
|
||||||
if (a.position < b.position)
|
|
||||||
return -1
|
|
||||||
if (a.position > b.position)
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
projectId: {
|
projectId: {
|
||||||
type: Number as PropType<IProject['id']>,
|
type: Number as PropType<IProject['id']>,
|
||||||
|
@ -268,8 +250,6 @@ function updateTasks(updatedTask: ITask) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// FIXME: Use computed
|
|
||||||
sortTasks(tasks.value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveTaskPosition(e) {
|
async function saveTaskPosition(e) {
|
||||||
|
|
Reference in New Issue
Block a user