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
|
||||
const bucketIndex = state.buckets.findIndex(({ tasks }) => {
|
||||
taskIndex = findIndexById(tasks, id)
|
||||
return taskIndex !== undefined
|
||||
return taskIndex !== -1
|
||||
})
|
||||
|
||||
|
||||
return {
|
||||
bucketIndex: taskIndex || null,
|
||||
taskIndex: taskIndex || null,
|
||||
task: state.buckets?.[bucketIndex].tasks?.[taskIndex] || null,
|
||||
bucketIndex: bucketIndex !== -1 ? bucketIndex : null,
|
||||
taskIndex: taskIndex !== -1 ? taskIndex : null,
|
||||
task: state.buckets[bucketIndex]?.tasks?.[taskIndex] || null,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue