fix: getTaskById function
This commit is contained in:
parent
35c861b711
commit
9b2e9fc17f
1 changed files with 5 additions and 5 deletions
|
@ -200,13 +200,13 @@ export default {
|
||||||
let taskIndex
|
let taskIndex
|
||||||
const bucketIndex = state.buckets.findIndex(({ tasks }) => {
|
const bucketIndex = state.buckets.findIndex(({ tasks }) => {
|
||||||
taskIndex = findIndexById(tasks, id)
|
taskIndex = findIndexById(tasks, id)
|
||||||
return taskIndex !== undefined
|
return taskIndex !== -1
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
bucketIndex: taskIndex || null,
|
bucketIndex: bucketIndex !== -1 ? bucketIndex : null,
|
||||||
taskIndex: taskIndex || null,
|
taskIndex: taskIndex !== -1 ? taskIndex : null,
|
||||||
task: state.buckets?.[bucketIndex].tasks?.[taskIndex] || null,
|
task: state.buckets[bucketIndex]?.tasks?.[taskIndex] || null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue