fix(task record): resume from the first step to not have ended

This commit is contained in:
Julien Calixte
2024-04-09 23:27:48 +02:00
parent 364d0b2eed
commit 046f33e0fb

View File

@@ -197,8 +197,8 @@ export const useTaskRecordStore = defineStore('task-record-store', {
}
const nextStepIndex = task.steps.findIndex(
(step) =>
!Object.keys(record.stepRecords).find((stepId) => stepId === step.id)
// the first step that has not ended
(step) => record.stepRecords[step.id]?.end === undefined
)
if (nextStepIndex >= 0) {