🐛 (record) when starting, set breaktime to undefined
This commit is contained in:
@@ -34,6 +34,14 @@ export const useTaskRecordStore = defineStore('task-record-store', {
|
|||||||
}) {
|
}) {
|
||||||
const record = this.records[params.taskId]
|
const record = this.records[params.taskId]
|
||||||
|
|
||||||
|
if (!record) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!record.stepRecords) {
|
||||||
|
record.stepRecords = {}
|
||||||
|
}
|
||||||
|
|
||||||
if (Object.values(record.stepRecords).length === 0) {
|
if (Object.values(record.stepRecords).length === 0) {
|
||||||
record.start = params.start
|
record.start = params.start
|
||||||
}
|
}
|
||||||
@@ -43,6 +51,7 @@ export const useTaskRecordStore = defineStore('task-record-store', {
|
|||||||
...this.records,
|
...this.records,
|
||||||
[params.taskId]: {
|
[params.taskId]: {
|
||||||
...record,
|
...record,
|
||||||
|
breakTime: undefined,
|
||||||
stepRecords: {
|
stepRecords: {
|
||||||
...record.stepRecords,
|
...record.stepRecords,
|
||||||
[params.stepId]: {
|
[params.stepId]: {
|
||||||
@@ -177,7 +186,7 @@ export const useTaskRecordStore = defineStore('task-record-store', {
|
|||||||
},
|
},
|
||||||
getStepRecord() {
|
getStepRecord() {
|
||||||
return (taskId: string, stepId: string): TimeRange | null =>
|
return (taskId: string, stepId: string): TimeRange | null =>
|
||||||
this.records[taskId]?.stepRecords[stepId] ?? null
|
this.records[taskId]?.stepRecords?.[stepId] ?? null
|
||||||
},
|
},
|
||||||
getRecordNotes() {
|
getRecordNotes() {
|
||||||
return (taskId: string): string => this.records[taskId]?.notes ?? ''
|
return (taskId: string): string => this.records[taskId]?.notes ?? ''
|
||||||
|
|||||||
Reference in New Issue
Block a user