fix: don't try to set the bucket of a task when it was moved to a new list
This commit is contained in:
parent
9616badc33
commit
c06b781837
1 changed files with 3 additions and 0 deletions
|
@ -30,6 +30,9 @@ function getTaskIndicesById(state: KanbanState, taskId: ITask['id']) {
|
||||||
|
|
||||||
const addTaskToBucketAndSort = (state: KanbanState, task: ITask) => {
|
const addTaskToBucketAndSort = (state: KanbanState, task: ITask) => {
|
||||||
const bucketIndex = findIndexById(state.buckets, task.bucketId)
|
const bucketIndex = findIndexById(state.buckets, task.bucketId)
|
||||||
|
if(typeof state.buckets[bucketIndex] === 'undefined') {
|
||||||
|
return
|
||||||
|
}
|
||||||
state.buckets[bucketIndex].tasks.push(task)
|
state.buckets[bucketIndex].tasks.push(task)
|
||||||
state.buckets[bucketIndex].tasks.sort((a, b) => a.kanbanPosition > b.kanbanPosition ? 1 : -1)
|
state.buckets[bucketIndex].tasks.sort((a, b) => a.kanbanPosition > b.kanbanPosition ? 1 : -1)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue